Card

Cards group related product information without creating nested or decorative panels.

Overview and decision boundary

Use Card to group a single related object or repeated item without turning page sections into nested panels.

Do not put cards inside cards or wrap entire page sections as decorative cards.

Preview

Launch workspace

Assets, owners, and milestones.

Active
12 active tasks across three owners.
Product update

Weekly report

Shared with the workspace.

Card guidance

One clear destination.

import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle, CardVisual } from '@nerio-ui/ui';<Card as="article">  <CardVisual>...</CardVisual>  <CardHeader>    <div>      <CardTitle as="h2">Launch workspace</CardTitle>      <CardDescription>Plan assets, owners, and milestones in one focused surface.</CardDescription>    </div>    <CardAction>...</CardAction>  </CardHeader>  <CardContent>12 active tasks</CardContent></Card>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm dlx nerio add cardimport { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle, CardVisual } from '@nerio-ui/ui';

Usage

import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle, CardVisual } from '@nerio-ui/ui';<Card as="article">  <CardVisual>...</CardVisual>  <CardHeader>    <div>      <CardTitle as="h2">Launch workspace</CardTitle>      <CardDescription>Plan assets, owners, and milestones in one focused surface.</CardDescription>    </div>    <CardAction>...</CardAction>  </CardHeader>  <CardContent>12 active tasks</CardContent></Card>

Variants

VariantPurpose
defaultDefault variant using semantic Nerio tokens.
secondarySupporting action with a visible control boundary.

Anatomy

SlotPurpose
cardBorderless surface container with radius, spacing, and soft elevation tokens.
card-visualOptional generic visual slot for icons, avatars, logos, previews, or media; inset by default and edge-to-edge when placement is bleed.
card-headerOptional heading area for title and supporting copy.
card-titleSemantic title slot for concise surface headings.
card-descriptionSecondary explanatory text.
card-actionOptional compact control or status aligned at the top end of the header.
card-contentProduct content such as object title, metadata, and actions.
card-footerActions or metadata aligned after the content.

States

StatePurpose
StaticGroups content without becoming clickable.
Inset visualUses CardVisual for an icon, avatar, logo, or compact preview.
Bleed visualUses CardVisual placement=bleed for edge-to-edge visual content.
Linkedhref renders a native anchor with hover and visible focus feedback.

Motion

  • Card has no default motion because grouped content should stay calm.
  • Linked Cards use a restrained surface transition and the shared focus ring.

Accessibility

  • Use Card to group related content, not to decorate every section.
  • Provide semantic headings inside cards when the content needs structure.
  • Use CardVisual for icons, avatars, logos, previews, and media; only bleed placement reaches the card edge.
  • Use CardAction only in a surface Card. Linked Cards cannot contain interactive descendants.
  • Avoid nesting cards inside cards.
  • Use href for a whole-card destination; it renders a native anchor with hover and focus feedback. Do not place interactive descendants inside a linked Card.

API

PropPurpose
assection, article, or div semantic wrapper.
hrefTurns the entire Card into a native anchor destination.
variantdefault or secondary; secondary is a muted borderless surface.
CardVisualGeneric visual slot with inset or bleed placement; child elements own image alt text and other media semantics.
CardActionOptional header-end slot for compact non-primary status or controls.
CardHeader / CardContent / CardFooterOptional layout slots for predictable anatomy.
CardTitle / CardDescriptionHeading and secondary text slots for documentation and registry examples.

Implementation contract

ContractValue
Registry itemcard installs 5 source files into the configured components directory.
Base UINo interactive primitive required.
Registry dependenciesNone.
Package dependenciesclsx, react, tailwind-merge, tailwindcss

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use Card for truly related content, not as a default wrapper for every section.
  • Use typography and spacing first; the default white or black surface carries only a soft elevation shadow, while secondary grouping stays flat and muted.

Do / do not

Do

Use for repeated summaries, project cards, or compact object groups.

Do not

Do not put cards inside cards or wrap entire page sections as decorative cards.

Tokens

These are the primary customization points. Override semantic or component tokens instead of changing component source.

TokenPurpose
--n-card-paddingPublic customization point for this component contract.
--n-card-padding-inlinePublic customization point for this component contract.
--n-card-padding-blockPublic customization point for this component contract.
--n-card-gapPublic customization point for this component contract.
--n-card-radiusPublic customization point for this component contract.
--n-card-backgroundPublic customization point for this component contract.
--n-card-background-interactive-hoverPublic customization point for this component contract.
--n-card-background-secondaryPublic customization point for this component contract.
--n-card-background-secondary-hoverPublic customization point for this component contract.
--n-card-border-secondaryPublic customization point for this component contract.
--n-card-border-interactivePublic customization point for this component contract.
--n-card-shadowPublic customization point for this component contract.
--n-card-shadow-secondaryPublic customization point for this component contract.
--n-motion-hover-durationPublic customization point for this component contract.
--n-motion-hover-easingPublic customization point for this component contract.
--n-motion-focus-durationPublic customization point for this component contract.
--n-motion-focus-easingPublic customization point for this component contract.
--n-focus-ringPublic customization point for this component contract.