Card

A container-style component used to display information in a structured and visually appealing way.

Usage

Basic Card

Render a basic Card.

<Card>
<Card.Header title="Card Title" subtitle="Subtitle here" />
<Card.Body content="This is the content of the card." />
<Card.Action justify={'end'}>
<Button variant={'outlined'} color={'gray'}>
Action 1
</Button>
<Button highContrast>Action 2</Button>
</Card.Action>
</Card>

Variants and Styles

Customize the appearance using the variant, textAlign, and outlined props.

<Card variant="transparent" outlined={false}>
<Card.Header
title="Card Title"
subtitle="Subtitle here"
action={
<Button variant={'transparent'} highContrast>
Action
</Button>
}
/>
<Card.Body textAlign="end" content="This is the content of the card." />
<Card.Action justify={'end'}>
<Button variant={'outlined'} color={'gray'}>
Action 1
</Button>
<Button highContrast>Action 2</Button>
</Card.Action>
</Card>

Shadow

Using the shadow prop we can adjust shadow values for the component.

<Card variant="transparent" shadow="4" outlined={false}>
<Card.Header title="Card Title" subtitle="Subtitle here" />
<Card.Body content="This is the content of the card." />
<Card.Action justify={'end'}>
<Button variant={'outlined'} color={'gray'}>
Action 1
</Button>
<Button highContrast>Action 2</Button>
</Card.Action>
</Card>

API

Props

Card

PropTypeDefaultRequired
variant'solid' | 'transparent' | 'translucent''solid'-
outlinedboolean'button'-
size'xlarge' | 'large' | 'medium' | 'small''medium'-
radiusThemeRadius--

Header

PropTypeDefaultRequired
titleReactNode-Yes
subtitleReactNode--
titleSizeTextSize4-
subtitleSizeTextSize4-
actionReactNode--
outlinedbooleanfalse-
MarginPropsToken<MarginProps>--
radiusThemeRadius--
sizeResponsive<Size>'medium'-
shadowThemeShadow--

Body

PropTypeDefaultRequired
titleReactNode-Yes
contentReactNode--
titleSizeTextSize4-
textAlign'start' | 'center' | 'end''start'-

Action

PropTypeDefaultRequired
outlinedbooleanfalse-
Button
Previous
Icon Button
Next