Glin UI
Primitive / Molecule

Card

Flexible surface container for grouped content.

Edit on GitHub
ProBilled monthly

$24/ seat

  • Unlimited projects
  • Priority support
  • Audit log export
MK

Maya Kovacs

Staff designer, Platform

48
Projects
1.2k
Reviews
36d
Streak

Installation

Install from
pnpm dlx @glinui/cli@latest add card

Prefer 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

variantneutralaccentsuccessdanger
glinr

glinr

neutral

glinr

accent

glinr

success

glinr

danger

solid

solid

neutral

solid

accent

solid

success

solid

danger

plain

plain

neutral

plain

accent

plain

success

plain

danger

soft

soft

neutral

soft

accent

soft

success

soft

danger

outline

outline

neutral

outline

accent

outline

success

outline

danger

ghost

ghost

neutral

ghost

accent

ghost

success

ghost

danger

gradient

gradient

neutral

gradient

accent

gradient

success

gradient

danger

glass

glass

neutral

glass

accent

glass

success

glass

danger

dark scope

variantneutralaccentsuccessdanger
glinr

glinr

neutral

glinr

accent

glinr

success

glinr

danger

solid

solid

neutral

solid

accent

solid

success

solid

danger

plain

plain

neutral

plain

accent

plain

success

plain

danger

soft

soft

neutral

soft

accent

soft

success

soft

danger

outline

outline

neutral

outline

accent

outline

success

outline

danger

ghost

ghost

neutral

ghost

accent

ghost

success

ghost

danger

gradient

gradient

neutral

gradient

accent

gradient

success

gradient

danger

glass

glass

neutral

glass

accent

glass

success

glass

danger

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 more

plain

Same content, four surfaces.

Learn more

solid

Same content, four surfaces.

Learn more

glass

Same content, four surfaces.

Learn more
import { 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

Updated 2 min ago
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 more

Security

Hover or focus to lift the card.

Learn more

Speed

Hover or focus to lift the card.

Learn more
import { Card } from "@glinui/ui"
<Card interactive tabIndex={0}>...</Card>

In a layout

A metrics card next to a soft accent upsell card.

Weekly revenue12.4%

$48,210

Upgrade

Unlock audit logs and SSO.

Learn more
import { 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

PropTypeRequiredDefaultDescription
variantCardVariant | nullNoambient (glinr)Surface look. Omitted follows the ambient design style: glinr, plain or glass. Glass is opt-in.
toneSurfaceToneNoneutralTone for soft, outline, ghost, gradient and glass.
interactivebooleanNofalseHover lift and pointer cursor.
insetbooleanNofalseRecessed well instead of a raised surface.
elevation / face / ring1 | 2 | 3 / 0 | 1 | 2 / default | hot | brand--Tune the glinr and solid looks.
size"sm" | "md" | "lg"NomdPadding density (p-4/p-6/p-8).
elevationunknownNo-Variant option from cardVariants.
faceunknownNo-Variant option from cardVariants.
ring"default" | "hot" | "brand"No-Variant option from cardVariants.

CardHeaderProps

PropTypeRequiredDefaultDescription
classNamestring--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

PropTypeRequiredDefaultDescription
classNamestringNo-Additional class names.

CardDescriptionProps

PropTypeRequiredDefaultDescription
classNamestringNo-Additional class names.

CardContentProps

PropTypeRequiredDefaultDescription
classNamestring--Additional class names.
insetbooleanNo-Recessed well with the concentric inner radius, for code, lists and inputs.
size"sm" | "md" | "lg"No"md"Variant option from cardSectionVariants.

CardFooterProps

PropTypeRequiredDefaultDescription
classNamestring--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.

Import

import { Card } from "@glinui/ui"

Source Files

Dependencies

@glinui/ui

Generated API Snapshot

Beta

Auto-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

PropTypeRequiredDefaultDescription
insetbooleanNo-Recessed well with the concentric inner radius, for code, lists and inputs.
size"sm" | "md" | "lg"No"md"Variant option from cardSectionVariants.

CardDescriptionProps

PropTypeRequiredDefaultDescription
classNamestringNo-Additional class names for description text.

CardFooterProps

PropTypeRequiredDefaultDescription
size"sm" | "md" | "lg"No"md"Variant option from cardSectionVariants.

CardHeaderProps

PropTypeRequiredDefaultDescription
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

PropTypeRequiredDefaultDescription
elevationunknownNo-Variant option from cardVariants.
faceunknownNo-Variant option from cardVariants.
insetbooleanNo-Render a recessed well instead of a raised surface.
interactivebooleanNo-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.
toneSurfaceToneNo"neutral"Tone for soft, outline, ghost, gradient and glass.
variantCardVariant | nullNo"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

PropTypeRequiredDefaultDescription
size"sm" | "md" | "lg"No"md"Variant option from cardSectionVariants.

CardTitleProps

PropTypeRequiredDefaultDescription
classNamestringNo-Additional class names for title text.