components/card/index.en-US.md
A card can be used to display content related to a single subject. The content can consist of multiple elements of varying types and sizes.
<code src="./demo/basic.tsx">Basic card</code> <code src="./demo/border-less.tsx" background="grey">No border</code> <code src="./demo/simple.tsx">Simple card</code> <code src="./demo/flexible-content.tsx">Customized content</code> <code src="./demo/in-column.tsx" background="grey">Card in column</code> <code src="./demo/loading.tsx">Loading card</code> <code src="./demo/grid-card.tsx">Grid card</code> <code src="./demo/inner.tsx">Inner card</code> <code src="./demo/tabs.tsx">With tabs</code> <code src="./demo/meta.tsx">Support more content configuration</code> <code src="./demo/style-class.tsx" version="6.0.0">Custom semantic dom styling</code> <code src="./demo/no-body-debug.tsx" debug>Cover and actions without body</code> <code src="./demo/component-token.tsx" debug>Component Token</code>
Common props ref:Common props
<Card title="Card title">Card content</Card>
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| actions | The action list, shows at the bottom of the Card | Array<ReactNode> | - | |
| activeTabKey | Current TabPane's key | string | - | |
Toggles rendering of the border around the card, please use variant instead | boolean | true | ||
Style of card body, please use styles.body instead | CSSProperties | - | - | |
| variant | Variants of Card | outlined | borderless | | outlined | 5.24.0 |
| classNames | Customize class for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string> | - | |
| cover | Card cover | ReactNode | - | |
| defaultActiveTabKey | Initial active TabPane's key, if activeTabKey is not set | string | The key of first tab | |
| extra | Content to render in the top-right corner of the card | ReactNode | - | |
| hoverable | Lift up when hovering card | boolean | false | |
Style of card head, please use styles.header instead | CSSProperties | - | - | |
| loading | Shows a loading indicator while the contents of the card are being fetched | boolean | false | |
| size | Size of card | medium | small | medium | |
| tabBarExtraContent | Extra content in tab bar | ReactNode | - | |
| tabList | List of TabPane's head | TabItemType[] | - | |
| tabProps | Tabs | - | - | |
| title | Card title | ReactNode | - | |
| type | Card style type, can be set to inner or not set | string | - | |
| styles | Customize inline style for each semantic structure inside the component. Supports object or function. | Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties> | - | |
| onTabChange | Callback when tab is switched | (key) => void | - |
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| className | The className of container | string | - | |
| hoverable | Lift up when hovering card grid | boolean | true | |
| style | The style object of container | CSSProperties | - |
| Property | Description | Type | Default | Version |
|---|---|---|---|---|
| avatar | Avatar or icon | ReactNode | - | |
| className | The className of container | string | - | |
| description | Description content | ReactNode | - | |
| style | The style object of container | CSSProperties | - | |
| title | Title content | ReactNode | - |
<code src="./demo/_semantic.tsx" simplify="true"></code>
<code src="./demo/_semantic_meta.tsx" simplify="true"></code>
<ComponentTokenTable component="Card"></ComponentTokenTable>