Skip to content

Commit d31e7f2

Browse files
Add documentation for the component
1 parent f504cba commit d31e7f2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/lib/Card/Card.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ import { Button } from "../Button";
55
import { ButtonSize, ButtonType, ButtonVariant } from "../Button/Button.types";
66
import "./Card.scss";
77

8+
/**
9+
* A stylized Code4rena card with 4 variants and optional footer, cta button, and title.
10+
* Requires an image tag for the top left corner and children for the body.
11+
*
12+
* __Available variants:__
13+
* - `TRANSPARENT` - makes the background of the card transparent
14+
* - `OUTLINED` - adds border around the card
15+
* - `COMPACT` - displays the body below the image to allow the card to be more narrow
16+
* - `BOTTOM_ALIGNED` - makes the title and body bottom aligned instead of top aligned
17+
*
18+
* @param children - Elements to be rendered inside the body of the card, passed in as children.
19+
* @param className - String of custom classes to extend the default styling of the component.
20+
* @param variants - Array of style variants to be applied to the rendered component.
21+
* @param footerDetails - Informational content to be rendered on the left side of the footer.
22+
* @param footerLinks - Array of anchor elements to be rendered in the right side of the footer.
23+
* @param imageSize - The size of the image displayed in the top corner. Can be small, medium or large. Defaults to medium
24+
* @param image - Image element to be rendered in the top left corner
25+
* @param imageBorderRadius - Border radius of the image. Can be circle, small, medium, or large. Defaults to circle.
26+
* @param title - The title to be rendered at the top of the card body. Can be string or react node.
27+
* @param cta - A call to action button rendered in the top right corner. Includes text and an onClick handler.
28+
*/
829
export const Card: React.FC<CardProps> = ({
930
children,
1031
className,

0 commit comments

Comments
 (0)