Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Forms

Radio

Free6.1 KB gzipped

A single option in a RadioGroup: a native radio (visually hidden but focusable) with a custom ring-and-dot indicator and a clickable label. ref points at the <input>. Outside a group it behaves like a plain native radio (name, checked/defaultChecked).

Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · Keys: Tab, Arrow keys, Space · Full report

Import

tsx
import { Radio, RadioGroup, RadioCard } from "@vjdesigns/vjdesigns-ui";

Importing only Radio adds about 6.1 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.

Examples

Basic

Radios live in a RadioGroup, which handles the name, the label and arrow-key navigation.

Notifications
tsx
import { Radio, RadioGroup } from "@vjdesigns/vjdesigns-ui";

export function Basic() {
  return (
    <RadioGroup label="Notifications" defaultValue="mentions">
      <Radio value="all" label="All new messages" />
      <Radio value="mentions" label="Direct messages and mentions" />
      <Radio value="none" label="Nothing" />
    </RadioGroup>
  );
}

Horizontal

Size
tsx
import { Radio, RadioGroup } from "@vjdesigns/vjdesigns-ui";

export function Horizontal() {
  return (
    <RadioGroup label="Size" orientation="horizontal" defaultValue="m">
      <Radio value="s" label="Small" />
      <Radio value="m" label="Medium" />
      <Radio value="l" label="Large" />
      <Radio value="xl" label="X-Large" disabled />
    </RadioGroup>
  );
}

Cards

RadioCard turns each option into a selectable card, for choices that need more context.

Plan
tsx
import { Badge, RadioCard, RadioGroup } from "@vjdesigns/vjdesigns-ui";

export function Cards() {
  return (
    <div style={{ width: "100%", maxWidth: "34rem" }}>
      <RadioGroup label="Plan" defaultValue="pro">
        <RadioCard value="core" title="Core" description="All core components, free forever." meta="$0" />
        <RadioCard
          value="pro"
          title="Pro"
          description="Adds date pickers, data tables, the command palette and more."
          meta={<Badge tone="primary">Popular</Badge>}
        />
        <RadioCard value="custom" title="Custom" description="A design system built around your product." meta="Let's talk" />
      </RadioGroup>
    </div>
  );
}

Accessibility

RadioGroup is a group of native radios: Tab enters the group at the selected option and the arrow keys move the choice. The group's label and description name and describe it, and a disabled option explains why in its own description.

Delivery speed
Express orders placed before 2 p.m. ship today.
tsx
import { Radio, RadioGroup } from "@vjdesigns/vjdesigns-ui";

export function Accessibility() {
  return (
    <RadioGroup
      label="Delivery speed"
      description="Express orders placed before 2 p.m. ship today."
      defaultValue="standard"
      required
    >
      <Radio value="standard" label="Standard" description="3–5 business days, free" />
      <Radio value="express" label="Express" description="Next business day, $12" />
      <Radio value="pickup" label="Store pickup" description="Not available for this address" disabled />
    </RadioGroup>
  );
}

Translated

In Hebrew the group mirrors: each radio sits to the right of its label, and the text aligns right. The labels are your own text.

שיטת משלוח
tsx
import { Radio, RadioGroup, LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import he from "@vjdesigns/vjdesigns-ui/locales/he";

export function Translated() {
  return (
    <LocaleProvider locale="he" messages={he}>
      <RadioGroup label="שיטת משלוח" defaultValue="regular">
        <Radio value="regular" label="משלוח רגיל" description="3–5 ימי עסקים" />
        <Radio value="express" label="משלוח מהיר" description="יום העסקים הבא" />
      </RadioGroup>
    </LocaleProvider>
  );
}

API reference

Radio

Radio props
PropTypeDefault
valueRequired

Value submitted with the form and reported by RadioGroup's onValueChange.

string—
label

Visible label. The whole label is clickable. Without one, pass aria-label.

ReactNode—
description

Supporting text under the label, linked with aria-describedby.

ReactNode—
disabled

Disables this option (the group's disabled also applies).

boolean—
size

Size. Inherits the group's size.

"sm""md""lg""md"
tone

Checked color. Inherits the group's tone.

"neutral""primary""accent""success""warning""danger""info""primary"
invalid

Invalid styling. Inherits the group's state.

boolean—
className

Class for the outer label element. The ref and other native props go to the input.

string—

Also accepts standard HTML attributes, plus className, style and ref.

RadioGroup

A set of mutually exclusive options. Renders role="radiogroup" around real native <input type="radio"> elements that share a name, so Tab lands on the checked (or first) option, arrow keys move and select, and the value submits with a form. Works standalone (with label) or inside a Fieldset/group Field, where it picks up the legend, hint, error, invalid, required, and disabled state.

RadioGroup props
PropTypeDefault
value

Selected value (controlled). Use with onValueChange.

string—
defaultValue

Initially selected value (uncontrolled). Leave unset for no initial selection.

string—
onValueChange

Called with the newly selected option's value.

(value: string) => void—
name

Shared name for the native radios (used in form submission). Generated with useId when omitted.

string—
orientation

Layout of the options. Horizontal options wrap onto new lines when space runs out.

"horizontal""vertical""vertical"
size

Size of every option. Falls back to a surrounding Field's size.

"sm""md""lg""md"
tone

Color of the checked ring and dot.

"neutral""primary""accent""success""warning""danger""info""primary"
disabled

Disables every option. Falls back to a surrounding Field's state.

boolean—
invalid

Marks the group invalid: danger borders and aria-invalid. Falls back to a surrounding Field's state.

boolean—
required

A selection is required: sets native required on the radios and aria-required on the group.

boolean—
label

Visible group label, used when the group stands alone. Ignored inside a group Field/Fieldset, whose legend already names the group. Without a label, pass aria-label or aria-labelledby.

ReactNode—
description

Help text below the group label, linked with aria-describedby.

ReactNode—
children

Radio or RadioCard options. May be wrapped in layout (e.g. a Grid of RadioCards).

ReactNode—

Also accepts native <div> attributes, plus className, style and ref.

RadioCard

A large, card-style radio option. The whole card is the <label>, with a native radio underneath, so keyboard, form, and screen reader behavior match Radio. When checked, the card shows a ring and the indicator turns into a filled check (shape, not color alone).

RadioCard props
PropTypeDefault
valueRequired

Value submitted with the form and reported by RadioGroup's onValueChange.

string—
titleRequired

Card title, in the display font. Becomes the radio's accessible name.

ReactNode—
description

Supporting text under the title, linked with aria-describedby.

ReactNode—
icon

Decorative icon shown in a tinted tile at the start of the header (e.g. <Icon name="star" />).

ReactNode—
media

Media (e.g. an <img>) shown full-bleed at the top of the card. Give images empty alt if decorative.

ReactNode—
meta

Price or meta slot, shown prominently under the description (e.g. "$29 / mo"). Linked with aria-describedby.

ReactNode—
children

Extra content at the bottom of the card (e.g. a feature list). Not part of the accessible name.

ReactNode—
disabled

Disables this option (the group's disabled also applies).

boolean—
tone

Selected ring and indicator color. Inherits the group's tone.

"neutral""primary""accent""success""warning""danger""info""primary"
invalid

Invalid styling. Inherits the group's state.

boolean—
className

Class for the card (label) element. The ref and other native props go to the input.

string—

Also accepts standard HTML attributes, plus className, style and ref.

See what changed in each version in the Changelog.

Accessibility report

Radio targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.

axe-core audit (live)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

36 passed · 0 failed · 29 not applicable · 10 to check by hand

Dark mode

Score 100

36 passed · 0 failed · 29 not applicable · 10 to check by hand

Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.

Built-in behavior

Keyboard

Keyboard
KeyAction
TabMoves into the group, on the selected radio (or the first).
Arrow keysMoves to and selects the next or previous radio, wrapping.
SpaceSelects the focused radio.

Roles and states

Roles and states
ElementRoleStates and properties
RadioGroupradiogrouparia-labelledby, aria-describedby, aria-required, aria-invalid
<input type="radio">radioChecked state is native; with a description, aria-labelledby → the label alone, so the description isn't read twice

Manual checks

Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck.2.1.1 (A), 2.1.2 (A)
FocusFocus moves in a logical order, is always visible, and isn't hidden behind sticky headers.2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA)
Screen readersNames, roles and states are announced correctly, and status changes are announced without moving focus.1.3.1 (A), 4.1.2 (A), 4.1.3 (AA)
ColorMeaning never depends on color alone; your own colors meet contrast in both modes.1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA)
Zoom and reflowAt 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed.1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA)
Pointer targetsClick and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap.2.5.8 (AA), 2.5.5 (AAA)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)