Card
A container that groups related content and actions, such as a product or a profile.
Saturday Run Club
We meet every Saturday at 8 am for an easy 5 km run. All paces are welcome, and we get coffee afterwards.
Usage
import { Card } from '@leverui/components';
<Card.Root>
<Card.Header />
<Card.Body />
<Card.Footer />
</Card.Root>
Examples
Variants
Use the variant prop to change the visual style of the Card.
Saturday Run Club
An easy 5 km run every Saturday at 8 am. All paces are welcome.
Saturday Run Club
An easy 5 km run every Saturday at 8 am. All paces are welcome.
Saturday Run Club
An easy 5 km run every Saturday at 8 am. All paces are welcome.
Within Form
Use the Card component within a form to group related fields together.
Create your account
Enter your name to get started.
Sizes
Use the size prop to change the size of the Card.
Card size: sm
Card size: md
Card size: lg
With Image
Use the Card component to display an image.

Green two-seat sofa
Deep cushions and wooden legs. It fits well in a small living room.
$389
Horizontal
Use the Card component to display content horizontally.

House latte
A latte is a shot of espresso topped with steamed milk.
With Avatar
Use the Card component to display an avatar.
Jonah Reyes
@jonahreyes
Jonah Reyes wants to join your team. Approve or decline the request.
Customization
Adding new variants
Give the card a class and style it. Load your CSS after the Lever UI stylesheet.
<Card.Root class="card-gradient">
<Card.Body>Content</Card.Body>
</Card.Root>
.card-gradient {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
Adding new sizes
Set --leverui-card-padding in your own class.
.card-xl {
--leverui-card-padding: var(--leverui-spacing-10);
}
.card-xl .leverui-card__title {
font-size: var(--leverui-font-sizes-2xl);
}
Changing defaults
Card.PropsProvider sets default props for the cards inside it. A prop on a
card wins.
<Card.PropsProvider value={{ variant: 'elevated', size: 'lg' }}>
<Card.Root>
<Card.Body>Content</Card.Body>
</Card.Root>
</Card.PropsProvider>
Updating the theme
Set --leverui-* variables on :root for every card, or on a class for some.
See the theme guide.
Props
Root
| Prop | Default | Type | Description |
|---|---|---|---|
size | md | 'sm' | 'md' | 'lg' | Card size. Responsive. |
variant | outline | 'elevated' | 'outline' | 'subtle' | Card style. Responsive. |
as | div | Native HTML tag | HTML tag to render. |
asChild | — | Solid render function | Render your own element with the card's props. |
unstyled | false | boolean | Turn off the Lever UI styles. |
Card.Title renders an h3 and Card.Description a p. Pass as to change
the tag.
Classes: .leverui-card__root, __header, __body, __footer, __title,
__description.
Explorer
Click a part name to highlight it in the preview.
Component Anatomy
Hover to highlight, click to select parts