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.

Curved architectural forms illuminated by soft light
Design system rollout

Bring components, owners, and release milestones into one shared workspace.

Track implementation progress and keep the team aligned through every release stage.

import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardVisual } from '@nerio-ui/ui';import { Button } from '@nerio-ui/ui/client';<Card as="div">  <CardVisual placement="bleed">    <img src="/card/abstract-architecture.jpg" alt="Curved architectural forms illuminated by soft light" />  </CardVisual>  <CardHeader>    <CardTitle>Design system rollout</CardTitle>    <CardDescription>Bring components, owners, and release milestones into one shared workspace.</CardDescription>  </CardHeader>  <CardContent>Track implementation progress and keep the team aligned through every release stage.</CardContent>  <CardFooter>    <Button>Open workspace</Button>  </CardFooter></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 exec nerio add cardimport { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardVisual } from '@nerio-ui/ui';import { Button } from '@nerio-ui/ui/client';

Usage

import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CardVisual } from '@nerio-ui/ui';import { Button } from '@nerio-ui/ui/client';<Card as="div">  <CardVisual placement="bleed">    <img src="/card/abstract-architecture.jpg" alt="Curved architectural forms illuminated by soft light" />  </CardVisual>  <CardHeader>    <CardTitle>Design system rollout</CardTitle>    <CardDescription>Bring components, owners, and release milestones into one shared workspace.</CardDescription>  </CardHeader>  <CardContent>Track implementation progress and keep the team aligned through every release stage.</CardContent>  <CardFooter>    <Button>Open workspace</Button>  </CardFooter></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 title area for primary and supporting copy.
card-titleConcise surface title that renders neutral text by default and supports an explicit heading element when document structure requires one.
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.
  • CardTitle renders a neutral div by default. Choose an explicit h2-h6 only when the card participates in the document outline, and preserve heading order.
  • 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.

Review the shared responsibility and evidence boundaries in the Accessibility foundation alongside this component-specific contract. Use the Spacing & layout foundation for shared density, wrapping, overflow, reflow, and component-versus-product ownership guidance. The Color foundation, Typography foundation, and Localization foundation define the shared visual-role, text-resilience, direction, and locale boundaries used by component examples.

API

PropPurpose
assection, article, or div semantic wrapper.
hrefTurns the entire Card into a native anchor destination.
variantdefault or secondary; secondary is a muted, flat 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 / CardDescriptionPrimary and secondary text slots. CardTitle defaults to div and CardDescription uses the standard 14 px body size.

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; every Card keeps a subtle mode-aware border, the default surface adds soft elevation, and secondary grouping stays flat and muted.
  • Keep the gap between visual, header, content, and footer larger than the internal title-description and action gaps.

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-section-gapPublic customization point for this component contract.
--n-card-header-gapPublic customization point for this component contract.
--n-card-footer-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-border-widthPublic customization point for this component contract.
--n-card-border-colorPublic 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.