Components · Layout
Card
Surface container for grouping related content. Supports flat, surface, and interactive variants.
import { Card } from '@nexub/react';Playground
Playground
LiveCards group related content on a raised surface.
<Card variant="surface" />Examples
Default
Variants
Card link
The whole card is one link named by its title. The button sits above the link with `relative z-[1]`.
Sheen
Move the pointer over the card.
Showcase (marketing mode)
Product accents on showcase cards, inside `data-mode="marketing"`.
Tilt
`effect="tilt"` (4.3): the card leans toward the pointer and the sheen catches the light. Hover with a mouse.
States
- Card title
Cards group related content on a raised surface.
default - Card title
Cards group related content on a raised surface.
variant="flat" - Card title
Cards group related content on a raised surface.
variant="surface" - Card title
Cards group related content on a raised surface.
variant="interactive" - Card title
Cards group related content on a raised surface.
variant="showcase" - Card title
Cards group related content on a raised surface.
tone="neutral" - Card title
Cards group related content on a raised surface.
tone="info" - Card title
Cards group related content on a raised surface.
tone="success" - Card title
Cards group related content on a raised surface.
tone="warning" - Card title
Cards group related content on a raised surface.
tone="danger" - Card title
Cards group related content on a raised surface.
tone="leap" - Card title
Cards group related content on a raised surface.
tone="bookub" - Card title
Cards group related content on a raised surface.
tone="payub"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'flat' | 'surface' | 'interactive' | 'showcase' | 'flat' | interactive lifts 2px on hover (spatial spring, elevation 1 → 2), sinks to 0.99 on press and adds a state layer. Use it for cards that are links or buttons. showcase is the marketing-mode card (24px corners, soft shadow, hover lift); a flat card outside data-mode="marketing". |
| accent | 'leap' | 'bookub' | 'payub' | 'founderub' | 'people' | 'contracts' | 'forms' | 'commerce' | 'money' | 'capital' | 'mind' | 'go' | 'command-hub' | 'runner' | 'book-hub' | 'payhub' | 'founder-hub' | 'os' | 'fintech' | 'intelligence' | 'autonomous' | — | With variant="showcase": an app- or division-coloured top edge and tint in marketing mode. An app key sets data-product, a division key data-division. Keys beyond leap, bookub, payub and founderub need @nexub/themes/products or @nexub/themes/divisions. Only for product-specific content. |
| effect | 'none' | 'sheen' | 'tilt' | 'none' | Opt-in. sheen is a soft light that follows the pointer, with a brighter rim near the edge. tilt (4.3) also leans the card toward the pointer in 3D. Off for touch, reduced motion and reduced transparency. |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'leap' | 'bookub' | 'payub' | 'founderub' | — | Applies a semantic left-border accent. |
| asChild | boolean | false | Merges props onto the immediate child element. |
| surface | 'solid' | 'glass' | 'solid' | Liquid-glass material treatment — see Foundations → Materials. |
| CardLink | AnchorHTMLAttributes & { asChild?: boolean } | — | Put it around the card title to make the whole card one link. Its ::after covers the card and the card shows the focus ring. Give other controls inside the card relative z-[1]. Use asChild for a router link. |
Design tokens
Card reads these component tokens. Each one is unset by default and falls back to the semantic role it aliases, so nothing changes until you set it. Set one on any element to restyle every Card below it, and leave the roles other components share alone. See the three token tiers.
| Token | Aliases | Notes |
|---|---|---|
| --card-bg | --color-surface-elevated | — |
| --card-fg | --color-on-surface | — |
| --card-border | --color-outline-variant | At 60% opacity. |
| --card-radius | --shape-container | — |
/* One area of your app */
.checkout {
--card-bg: var(--color-secondary);
}Accessibility
ARIA roles
Keyboard
- Tab
Focuses interactive children. The card itself is never focusable; with a CardLink, the link is.
Focus
With a CardLink inside, the focus ring is drawn on the card, not around the title.
Prefer CardLink over wrapping the whole card in `<a>`: the link’s accessible name stays the title instead of every word on the card.
Screen reader
Group related content with a heading inside the Card so AT users can navigate by heading level.
On iOS & Android: Card
import { Card } from '@nexub/react-native';
<Card onPress={open} accessibilityLabel="Savings, 2,400 dollars">…</Card>Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Interaction | variant="interactive" lifts on hover; CardLink makes it one link. | onPress makes the whole card one pressable with an accessibility label. |
| Surface | flat, surface, interactive; glass. | Tonal Surface tiers and elevation; glass on iOS 26+. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
Card props
| Prop | Type | Default | Description |
|---|---|---|---|
| onPress | () => void | — | Makes the whole card one pressable target (navigates to detail). |
| accessibilityLabel | string | — | Accessible name when pressable. |
| tone | SurfaceTone | ToneValue | 'surface-container-low' | A surface tier (surface-container-low, …) sets the card's background. A semantic or
product tone (info, danger, payub, …) adds a coloured start edge, as on web. |
| variant | 'flat' | 'surface' | 'interactive' | 'flat' | flat sits on its tier with no shadow. surface and interactive lift the card one
elevation step on surface-elevated (interactive is for a card with onPress). |
| surface | 'solid' | 'glass' | 'solid' | The card's material, as on web: glass is Liquid Glass on iOS 26+, a solid elevated tier elsewhere. |
| elevation | 0 | 1 | 2 | 3 | 0 | — |
| material | 'solid' | 'glass' | 'solid' | 'glass' is for the control layer only (bars, floating controls), never content. |
| radius | ShapeName | number | — | Corner radius: a shape token or dp. |