Skip to content
nexubDesign System
v2.4.0

Components · Layout

Card

Stablev0.0.1 → v1.6.0

Surface container for grouping related content. Supports flat, surface, and interactive variants.

import { Card } from '@nexub/react';

Playground

Playground

Live
Card title

Cards group related content on a raised surface.

<Card variant="surface" />

Examples

Default

Variants

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.

Props

Props
PropTypeDefaultDescription
variant'flat' | 'surface' | 'interactive''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.
effect'none' | 'sheen''none'Opt-in. sheen is a soft light that follows the pointer, with a brighter rim near the edge. Off for touch, reduced motion and reduced transparency.
toneToneValueundefinedApplies a semantic left-border accent.
asChildbooleanfalseMerges props onto the immediate child element.
surface'solid' | 'glass''solid'Liquid-glass material treatment — see Foundations → Materials.
CardLinkAnchorHTMLAttributes & { 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.

Accessibility

ARIA roles

region (when used as a landmark)

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.