Card
Cards are flexible containers for grouping related content and actions.
Basic card
Share of voice
Your brand appeared in 38% of ChatGPT answers about project management tools this week.
Liquid glass
Pass variant="liquid-glass" to enable real-time WebGL2 optical rim refraction powered by GlassLayer with a translucent CSS fallback on first paint and non-WebGL browsers. Use live when animated content moves behind the card.
Inspect the curved corners to see the backdrop pull subtly toward the center.
Materials
Combine variant="liquid-glass" with material (frosted, clear, or tinted) and set refract={false} when you want pure CSS glass without a WebGL canvas.
Diffuses busy backgrounds while preserving AA contrast.
Minimal tint with 6px optical blur and vivid saturation.
Holds brand or semantic color while keeping edge depth.
Zero bleed-through for nested cards or dense data.
Backgrounds
The default background is primary.
Primary
Secondary
Tertiary
Quaternary
Padding
sm adds 16 px of padding and md adds 24 px. The default is none.
Small padding
16 px. Use it for compact cards in grids and side panels.
Medium padding
24 px. Use it for standalone cards such as report summaries.
Installation
pnpm dlx shadcn@latest add @narakui/cardAdd "@narakui": "https://ui.narakcode.dev/r/{name}.json" to components.json, or install directly from https://ui.narakcode.dev/r/card.json.
Usage
import { Card } from '@/components/ui/card';
<Card padding="sm">Default matte card</Card>
<Card variant="liquid-glass" padding="sm">
Liquid glass card with WebGL2 optical refraction
</Card>Properties
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'liquid-glass' | 'default' | Matte NarakUI surface (default) or optical liquid glass (liquid-glass) |
background | 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'primary' | Semantic background surface tier of the card |
padding | 'none' | 'sm' | 'md' | 'none' | Apply a predefined internal padding size |
material | 'frosted' | 'clear' | 'tinted' | 'solid' | 'frosted' (on liquid-glass) / 'solid' (on default) | Glass surface material preset |
refract | boolean | true (on liquid-glass) / false (on default) | Enables real-time WebGL2 rim refraction via GlassLayer |
blur | number | 6 (frosted) / 4 (clear) | Backdrop frost blur in pixels |
tint | number | Tier default | Backdrop tint opacity (0 to 1) |
live | boolean | false | Repaints the refracted backdrop every frame for animated scenes behind the card |
backdrop | string | — | CSS selector of an ancestor whose content is refracted instead of the page |
interactive | boolean | false | Enables press feedback and hover rim response |
cursorLight | boolean | Matches interactive | Enables cursor-tracking specular rim highlight on fine pointers |
optics | CardOptics | — | Fine-tuned GlassLayer optical parameters |
className | string | — | Additional CSS classes to apply to the card container |