pnpm dlx @glinui/cli@latest add card$24/ seat
- Unlimited projects
- Priority support
- Audit log export
Maya Kovacs
Staff designer, Platform
- 48
- Projects
- 1.2k
- Reviews
- 36d
- Streak
Installation
pnpm dlx @glinui/cli@latest add cardPrefer the package?
Usage
Variants
The full vocabulary across tones in both theme scopes. glinr is the default, plain is the flat shadcn card, solid is a neutral tonal face, glass is opt-in.
light scope
| variant | neutral | accent | success | danger |
|---|---|---|---|---|
| glinr | glinrneutral | glinraccent | glinrsuccess | glinrdanger |
| solid | solidneutral | solidaccent | solidsuccess | soliddanger |
| plain | plainneutral | plainaccent | plainsuccess | plaindanger |
| soft | softneutral | softaccent | softsuccess | softdanger |
| outline | outlineneutral | outlineaccent | outlinesuccess | outlinedanger |
| ghost | ghostneutral | ghostaccent | ghostsuccess | ghostdanger |
| gradient | gradientneutral | gradientaccent | gradientsuccess | gradientdanger |
| glass | glassneutral | glassaccent | glasssuccess | glassdanger |
dark scope
| variant | neutral | accent | success | danger |
|---|---|---|---|---|
| glinr | glinrneutral | glinraccent | glinrsuccess | glinrdanger |
| solid | solidneutral | solidaccent | solidsuccess | soliddanger |
| plain | plainneutral | plainaccent | plainsuccess | plaindanger |
| soft | softneutral | softaccent | softsuccess | softdanger |
| outline | outlineneutral | outlineaccent | outlinesuccess | outlinedanger |
| ghost | ghostneutral | ghostaccent | ghostsuccess | ghostdanger |
| gradient | gradientneutral | gradientaccent | gradientsuccess | gradientdanger |
| glass | glassneutral | glassaccent | glasssuccess | glassdanger |
import { Card } from "@glinui/ui"
<Card variant="glinr" /><Card variant="plain" /><Card variant="solid" /><Card variant="soft" tone="accent" /><Card variant="outline" /><Card variant="ghost" /><Card variant="gradient" /><Card variant="glass" />Glass on a backdrop
Four surfaces over a vivid backdrop. Glass needs a backdrop to read as glass.
glinr
Same content, four surfaces.
Learn moreplain
Same content, four surfaces.
Learn moresolid
Same content, four surfaces.
Learn moreglass
Same content, four surfaces.
Learn moreimport { Card } from "@glinui/ui"
<Card variant="glinr" /><Card variant="plain" /><Card variant="solid" /><Card variant="glass" />Header and well
`CardHeader variant="strip"` is a raised strip that bleeds to the card edges. `CardContent inset` is a recessed well with the concentric inner radius.
deploy.log
Passing$ pnpm build
compiled 128 modules in 4.2s
$ pnpm deploy --prod
import { Badge, Button, Card, CardContent, CardFooter, CardHeader, CardTitle } from "@glinui/ui"
export function Demo() { return ( <Card> <CardHeader variant="strip" className="flex items-center justify-between"> <CardTitle>deploy.log</CardTitle> <Badge tone="success" variant="soft" dot>Passing</Badge> </CardHeader> <CardContent inset className="font-mono">$ pnpm build</CardContent> <CardFooter><Button size="sm">Redeploy</Button></CardFooter> </Card> )}Interactive
`interactive` adds a hover lift and a pointer cursor. Make the card focusable and keyboard-operable yourself when it acts as a control.
Analytics
Hover or focus to lift the card.
Learn moreSecurity
Hover or focus to lift the card.
Learn moreSpeed
Hover or focus to lift the card.
Learn moreimport { Card } from "@glinui/ui"
<Card interactive tabIndex={0}>...</Card>In a layout
A metrics card next to a soft accent upsell card.
$48,210
Upgrade
Unlock audit logs and SSO.
Learn moreimport { Card } from "@glinui/ui"
<section className="grid gap-4 sm:grid-cols-3"> <Card className="sm:col-span-2">...</Card> <Card variant="soft" tone="accent">...</Card></section>Variants
Use the background toggle (top-right) to test each variant against different surfaces.
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from "@glinui/ui"
export function CardVariantDemo() {
return (
<div className="grid gap-3 md:grid-cols-2">
<Card variant="glass"><CardHeader><CardTitle>Glass</CardTitle></CardHeader><CardContent>Standard translucent surface with subtle refraction.</CardContent></Card>
<Card variant="frosted"><CardHeader><CardTitle>Frosted</CardTitle></CardHeader><CardContent>Heavy frost with stronger blur and inner glow.</CardContent></Card>
<Card variant="liquid"><CardHeader><CardTitle>Liquid</CardTitle></CardHeader><CardContent>Wet-glass effect with radial highlights.</CardContent></Card>
<Card variant="matte"><CardHeader><CardTitle>Matte</CardTitle></CardHeader><CardContent>Solid opaque surface with soft shadow.</CardContent></Card>
</div>
)
}Frosted on Vivid Background
The frosted variant shines against colorful backgrounds where the blur and inner glow create visible depth.
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "@glinui/ui"
export function CardFrostedDemo() {
return (
<Card variant="frosted" className="max-w-sm">
<CardHeader>
<CardTitle>Analytics</CardTitle>
<CardDescription>Real-time dashboard metrics.</CardDescription>
</CardHeader>
<CardContent>
<div className="text-3xl font-bold tracking-tight">12,847</div>
<p className="text-sm text-neutral-600 dark:text-neutral-300">+23% from last week</p>
</CardContent>
<CardFooter className="text-xs text-neutral-500">Updated 2 min ago</CardFooter>
</Card>
)
}Lift surface
elevation 1-3, face 0-2 and ring default|hot|brand opt a card into the lift technique. inset renders a recessed well.
import { Card } from "@glinui/ui"
export function Demo() {
return (
<div className="grid gap-4 sm:grid-cols-3">
<Card elevation={1} face={0}>Elevation 1</Card>
<Card elevation={2} face={1} ring="hot">Hot ring</Card>
<Card elevation={3} face={2} ring="brand">Brand ring</Card>
<Card inset>Inset well</Card>
</div>
)
}Accessibility
- Semantic `<div>` containers.
- Use `CardTitle` for heading hierarchy.
- Add landmark roles if card represents a section.
- Card uses semantic section content you provide.
- Prefer heading levels that match page hierarchy.
ARIA Attributes
- Semantic divs
- Heading hierarchy via CardTitle
Reduced Motion
No animation dependencies.
Card supports reduced-motion fallback for transition-heavy states.
API Reference
CardProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
variant | CardVariant | null | No | ambient (glinr) | Surface look. Omitted follows the ambient design style: glinr, plain or glass. Glass is opt-in. |
tone | SurfaceTone | No | neutral | Tone for soft, outline, ghost, gradient and glass. |
interactive | boolean | No | false | Hover lift and pointer cursor. |
inset | boolean | No | false | Recessed well instead of a raised surface. |
elevation / face / ring | 1 | 2 | 3 / 0 | 1 | 2 / default | hot | brand | - | - | Tune the glinr and solid looks. |
size | "sm" | "md" | "lg" | No | md | Padding density (p-4/p-6/p-8). |
elevation | unknown | No | - | Variant option from cardVariants. |
face | unknown | No | - | Variant option from cardVariants. |
ring | "default" | "hot" | "brand" | No | - | Variant option from cardVariants. |
CardHeaderProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | - | - | Additional class names. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardSectionVariants. |
variant | "default" | "strip" | No | "default" | `strip` renders a raised header band that bleeds to the card edges (glinr and solid cards). |
CardTitleProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | No | - | Additional class names. |
CardDescriptionProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | No | - | Additional class names. |
CardContentProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | - | - | Additional class names. |
inset | boolean | No | - | Recessed well with the concentric inner radius, for code, lists and inputs. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardSectionVariants. |
CardFooterProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | - | - | Additional class names. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardSectionVariants. |
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Generated API Snapshot
Beta
Generated API Snapshot
BetaAuto-extracted from TypeScript source in packages/ui/src/components/card.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.
Generated: 2026-10-08T01:41:21.546Z · Full index: /docs/api-metadata
Primary Props Type
CardProps
CardContentProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
inset | boolean | No | - | Recessed well with the concentric inner radius, for code, lists and inputs. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardSectionVariants. |
CardDescriptionProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | No | - | Additional class names for description text. |
CardFooterProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardSectionVariants. |
CardHeaderProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardSectionVariants. |
variant | "default" | "strip" | No | "default" | `strip` renders a raised header band that bleeds to the card edges (glinr and solid cards). |
CardProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
elevation | unknown | No | - | Variant option from cardVariants. |
face | unknown | No | - | Variant option from cardVariants. |
inset | boolean | No | - | Render a recessed well instead of a raised surface. |
interactive | boolean | No | - | Adds hover lift and a pointer cursor. Keyboard behavior stays with the consumer. |
ring | "default" | "hot" | "brand" | No | - | Variant option from cardVariants. |
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardVariants. |
tone | SurfaceTone | No | "neutral" | Tone for soft, outline, ghost, gradient and glass. |
variant | CardVariant | null | No | "default" | Surface look. Omitted (or `default`) follows the ambient design style: glinr, plain or glass. `glinr` lift shell, `plain` flat shadcn card, `solid` neutral tonal, `soft`, `outline`, `ghost`, `gradient`, `glass` (opt-in, needs a backdrop). Legacy `elevated`, `interactive`, `lift`, `frosted`, `liquid`, `matte` keep working. |
CardSectionProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
size | "sm" | "md" | "lg" | No | "md" | Variant option from cardSectionVariants. |
CardTitleProps
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
className | string | No | - | Additional class names for title text. |