Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

Card

  • Stable
  • WCAG 2.2 evidence
  • RTL

A bordered surface that groups related content: an optional media area, a header with icon tile and title, a body, free content and a footer with meta text and an action. Presentational: no state, no effects and no "use client", so it renders in React Server Components. With href the title is a native link stretched over the card (one target, one clean link name), the card lifts on hover and shows the focus ring on keyboard focus (WCAG 2.1.1, 2.4.7, 2.5.8). Selected and disabled are shown by more than colour: the check icon with visually hidden text, and the dimmed aria-disabled card (1.4.1, 4.1.2). Text wraps (1.4.10, 1.4.12). Click handlers need a client component: wrap the card, or use href. Use ListItem for rows of similar items and do not nest cards. Consumer duties: heading level, image alternatives (alt), link wording, and locale-aware formatting of dates and numbers in the text.

import { Card } from "@nexera-ui/react";
Loading example…
11
examples
16
props
4
live controls
1
platform
11
WCAG criteria
5
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
title
children
isSelected
isDisabled
Generated code
import { Card } from "@nexera-ui/react";

<Card />

Examples 10

The same examples as Storybook, rendered live. Open Code to copy one.

Interactive

Figma State=Interactive: with href the title is a link stretched over the card. Hover lifts it; Tab shows the focus ring.

Loading example…

Selected

Figma State=Selected (isSelected): tinted fill, brand stroke, check icon and the visually hidden text "Selected".

Loading example…

Disabled

Figma State=Disabled (isDisabled): dimmed and aria-disabled; the title is not a link.

Loading example…

With media

Figma Media=Yes (media slot): a 140 px area above the content.

Loading example…

Optional parts

The footer exists when meta or action is given; the header when there is a title, an icon or the selected check.

Loading example…

Long content

Long and translated text wraps in the title, body and footer; the card grows.

Loading example…

Right to left

Right-to-left: the icon tile moves to the start (right) edge and the footer action to the end (left).

Loading example…

Narrow container

A 14 rem container: the footer wraps and the text keeps wrapping.

Loading example…

In a grid

Cards fill their grid cells; give the grid auto-fill columns so they reflow without media queries.

Loading example…

Plan comparison

Loading example…

Props 16

Press "Try it" on a card to load that prop into the playground.

16 props shown

hrefNexera
string

Not set: the card is not a link. Destination. The title becomes a native link stretched over the whole card. Renders in Server Components; for client-side routing wrap the card in your router's link behaviour or pass a router-aware href.

Default –
targetNexera
string

Only with href. Link target, for example _blank.

Default –
relNexera
string

Only with href. Link relation, for example noopener.

Default –
downloadNexera
string | boolean

Only with href. Downloads the target; the value is the suggested file name.

Default –
hrefLangNexera
string

Only with href. Language of the target.

Default –
titleNexera
ReactNode

Heading of the card. Required with href: it becomes the link text, so it is the accessible name of the interactive card. Wraps instead of truncating. Required with href: the title is the link text.

Default –
titleLevelNexera
1 | 2 | 3 | 4 | 5 | 6

Makes the title a heading of this level (<h2> to <h6>), so the cards of a page appear in the heading list. Without it the title is plain text.

Default –
bodyNexera
ReactNode

Supporting text. Shown when provided.

Default –
metaNexera
ReactNode

Small print at the start of the footer. The footer is shown when meta or action is provided.

Default –
actionNexera
ReactNode

Text or element at the end of the footer. On a card with href keep it plain text (a link inside a link is invalid); on a static card it may be a Button or link. Shown when provided.

Default –
iconNexera
ReactNode

Icon in the tile before the title. 18 px, decorative. Shown when provided.

Default –
mediaNexera
ReactNode

Media above the content. Pass an <img> (or Image) with className="size-full object-cover". Replaces the plan's boolean isMedia: a flag alone cannot carry the picture. Decorative pictures use alt="".

Default –
childrenNexera
ReactNode

Free content after the body (chips, a progress bar,...). Not in Figma.

Default –
isSelectedNexera
boolean

The card is the chosen one: tinted fill, brand stroke and a check icon. The state is also text (selectedLabel), so it never depends on colour (WCAG 1.4.1). For choosing between options use CheckboxCard or RadioCard.

Default false
isDisabledNexera
boolean

The card is unavailable: dimmed, aria-disabled, and its title is not a link.

Default false
selectedLabelNexera
string

Visually hidden text read after the title of a selected card. Translate it.

Default Selected

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

6 direct · 5 supporting
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.4Resize TextLevel AA · supporting test
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 1.4.12Text SpacingLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.4Link Purpose (In Context)Level A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 3.1.2Language of PartsLevel AA · tested directly
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

Usage
<Card className="shadow-sm" />

Used in blocks

Related components