As a developer
I want to be able to use a Card component
so that I can create container for text, photos, and actions in the context of a single subject
The component should contain:
[x] Embedded className called dcx-card
[x] Embedded className called dcx-card--selected when the prop selected is true
[x] Embedded className called dcx-card-header
[x] Embedded className called dcx-card-content
[x] Embedded className called dcx-card-image
[x] Embedded className called dcx-card-actions
[x] Embedded className called dcx-card-footer
[x] dcx-card should have two variants normal or default simple behavior and action for actionable behavior
[x] dcx-card For actionable behavior need optional selected boolean prop
children: JSX.Element[];
//Relevant classes for shared / reusable styling
className?: string;
//additional properties to support something else that we didn't plan
props?: React.HTMLAttributes<HTMLElement>;
Code Guidance (CardImage):
//Relevant classes for shared / reusable styling
className?: string;
//additional properties to support something else that we didn't plan
props?: React.HTMLAttributes<HTMLElement>;
// src of the image to add
src: string;
// alternative text of the image
alt: string;
Example:
<Card className="" props={{}}>
<CardHeader className="" props={{}}>{{ Section anchored to the top of the card (adds padding) }}</CardHeader>
<CardContent className="" props={{}}>{{ Primary card content (adds padding) }}</CardContext>
<CardImage className="" src="" alt="" props={{}}>{{ Card image. Stretches the image to the container width }}</CardImage>
<CardActions className="" props={{}}>{{ Container for buttons at the bottom of the card (adds padding) }}</CardActions>
<CardFooter className="" props={{}}>{{ Section anchored to the bottom of the card }}</CardFooter>
</Card>
Behind the scenes the Card component could be like so:
As a developer I want to be able to use a
Card
component so that I can create container for text, photos, and actions in the context of a single subjectThe component should contain:
dcx-card
dcx-card--selected
when the prop selected is truedcx-card-header
dcx-card-content
dcx-card-image
dcx-card-actions
dcx-card-footer
dcx-card
should have two variants normal or default simple behavior and action for actionable behaviordcx-card
For actionable behavior need optional selected boolean propCode Guidance:
Available Props:
Code Guidance (Card, CardHeader, CardContent, CardActions, CardFooter):
Code Guidance (CardImage):
Example:
Behind the scenes the
Card
component could be like so:Tasks:
Layout
Please follow the below to create your branch