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

RadioCard

  • Stable
  • WCAG 2.2 evidence
  • RTL

A large option of a RadioGroup with an icon, a title, an optional meta tag and a description, for a few options that need explanation (work location, plan). The whole card is one <label> around a native radio, so a click or tap anywhere selects it (WCAG 2.5.8); the group is one Tab stop, arrows move and select, Space selects (2.1.1). The title is the accessible name; meta and description are linked with aria-describedby (1.3.1, 4.1.2). Selected shows a dot in the circle and a thicker brand border, not only a colour change (1.4.1); keyboard focus draws the ring around the card (2.4.7). Must be rendered inside a RadioGroup. Consumer duties: wording.

import { RadioCard } from "@nexera-ui/react";
Loading example…
5
examples
19
props
2
live controls
1
platform
12
WCAG criteria
4
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…
description
isDisabled
Generated code
import { RadioCard } from "@nexera-ui/react";

<RadioCard />

Examples 4

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

In group

Cards of a group with meta, one selected and one disabled.

Loading example…

Invalid

Figma Radio group Type=Card, State=Error: the cards take the danger stroke and the group shows the error.

Loading example…

Long text

Title, meta and description wrap; the card grows with its content.

Loading example…

Right to left

Right-to-left: icon tile at the start (right), circle at the end (left).

Loading example…

Props 19

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

19 props shown

iconNexera
ReactNode

Icon in the 40 px tile before the text. Decorative. The tile is shown when an icon is provided.

Default –
descriptionNexera
ReactNode

Supporting text under the title. Linked with aria-describedby. Plain text: it sits inside the clickable card, so it must not contain links or buttons.

Default –
metaNexera
ReactNode

Short tag next to the title. Read after the title as part of the description. Shown when provided.

Default –
classNameNexera
string

Extra classes for the root, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style of the root.

Default –
titleNexera
VisibleContent

Visible title. It is the accessible name; wraps and is never truncated. No visible title.

Default –
aria-labelNexera
string

Overrides the name given by title. Avoid: the name must contain the visible text (WCAG 2.5.3). Accessible name. Translate it. Accessible name; aria-labelledby wins when both are set.

Default –
aria-labelledbyNexera
string

Id(s) of element(s) that name the card instead of title. Id(s) of element(s) that name the card; wins over aria-label. Id(s) of visible element(s) that name the card.

Default –
value*React Aria
string

The value of the radio button, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio#Value).

Default –
isDisabledReact Aria
boolean

Whether the radio button is disabled or not. Shows that a selection exists, but is not available in that circumstance.

Default –
autoFocusReact Aria
boolean

Whether the element should receive focus on render.

Default –
idReact Aria
string

The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –
onPressReact Aria
(e: PressEvent) => void

Handler that is called when the press is released over the target.

Default –
onPressStartReact Aria
(e: PressEvent) => void

Handler that is called when a press interaction starts.

Default –
onPressEndReact Aria
(e: PressEvent) => void

Handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.

Default –
onPressChangeReact Aria
(isPressed: boolean) => void

Handler that is called when the press state changes.

Default –
onPressUpReact Aria
(e: PressEvent) => void

Handler that is called when a press is released over the target, regardless of whether it started on the target or not.

Default –
inputRefReact Aria
Ref<HTMLInputElement | null>

A ref for the HTML input element.

Default –

* 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

8 direct · 4 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 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.7Focus VisibleLevel AA · tested directly
  • 2.5.3Label in NameLevel A · tested directly
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 3.3.1Error IdentificationLevel A · 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:.

  • data-disabled
  • data-hovered
  • data-invalid
  • data-readonly
  • data-selected
Usage
<RadioCard className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components