Skip to content
Nana UI

Layout & Containers

Card

A surface container that groups related content. Compose it with nana-card-header, nana-card-title, nana-card-description, nana-card-content and nana-card-footer.

View .md Download
Card title A short supporting description. A card groups related content into a single surface. Action

The card ships for all three targets. Pick the tab for your project — the CLI detects which you are on and serves the matching implementation.

npx @nana-tec/ui add card

Lands as src/components/ui/card/card.tsx, styled with Tailwind classes that resolve to the design tokens. Requires Tailwind v4.

import {
Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter,
} from "@/components/ui/card";
import { Button } from "@/components/ui/button";
export function Example() {
return (
<Card variant="elevated">
<CardHeader>
<CardTitle>Card title</CardTitle>
<CardDescription>A short supporting description.</CardDescription>
</CardHeader>
<CardContent>A card groups related content into a single surface.</CardContent>
<CardFooter>
<Button size="sm">Action</Button>
</CardFooter>
</Card>
);
}

Every part is optional and each is a plain div (or h3 / p for the title and description), so you can compose or skip them freely.

Classes you pass to the React and Svelte components are merged with tailwind-merge, so an override wins rather than fighting. See Using Tailwind.

The variant attribute sets the card’s surface treatment — default, elevated, outlined, filled, or glass.

Default Elevated Outlined Filled Glass

Add the interactive attribute to make the whole card a hoverable, focusable target (e.g. a link card).

Interactive card Hover or focus me Lifts on hover and shows a focus ring.

The React and Svelte props, read from the components’ own types:

Card

PropTypeDefault
variantCardVariant'default'

Also accepts HTMLAttributes<HTMLDivElement>.

The attribute names, events and CSS hooks below are the Web Components reference.

Properties

PropertyAttributeTypeDefaultDescription
interactiveinteractivebooleanfalseAdds hover lift, pointer cursor and a focus ring for clickable cards. Composes with any variant.
variantvariantCardVariant'default'Visual style

Slots

SlotDescription
(default)Card sub-sections (header, content, footer)

CSS custom properties

PropertyDescription
--nana-card-bgBackground colour
--nana-card-colorText colour
--nana-card-radiusCorner radius
SlotDescription
(default)Card sub-sections (header, content, footer)
VariableDescription
--nana-card-bgBackground colour
--nana-card-colorText colour
--nana-card-radiusCorner radius
Explore Card interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook