Skip to content
Nana UI

Radio

View .md Download

A single radio control — a circle + label. Selection is mutually exclusive and owned by the parent nana-radio-group, which manages the checked value, keyboard roving and form association; on its own a radio still renders and fires nana-change. Rebrand by overriding --nana-radio-accent (or the global --nana-surface-accent) — no need to fork the component.

Card Cash
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/radio";
<nana-radio-group value="card" label="Payment">
<nana-radio value="card">Card</nana-radio>
<nana-radio value="cash">Cash</nana-radio>
</nana-radio-group>

Each nana-radio takes a label and optional description.

Set orientation="horizontal" on the group.

Properties

PropertyAttributeTypeDefaultDescription
checkedbooleanfalseSelected state (normally driven by nana-radio-group)
descriptionstring | undefinedSecondary descriptive text
disabledbooleanfalseDisable the control
invalidbooleanfalseInvalid styling (set by the group when its validation fails)
labelstring | undefinedConvenience label text (slot wins if both are present)
sizeRadioSize'md'Control size
valuestring''Submitted / emitted value for this option

Events

EventDescription
nana-changeFired on selection (`detail.value`)

Slots

SlotDescription
(default)The label (overrides the `label` attribute)
descriptionSecondary descriptive text

CSS parts

PartDescription
::part(control)The clickable row
::part(circle)The radio circle
::part(label)The label text

CSS custom properties

PropertyDescription
--nana-radio-accentSelected fill / border colour
--nana-radio-dot-colorInner dot colour
--nana-radio-borderUnselected border colour
--nana-radio-bgCircle background
--nana-radio-sizeCircle diameter (overrides size preset)
EventTypeDescription
nana-changeCustomEventFired on selection (detail.value)
SlotDescription
(default)The label (overrides the label attribute)
descriptionSecondary descriptive text
VariableDefaultDescription
--nana-radio-accentSelected fill / border colour
--nana-radio-dot-colorInner dot colour
--nana-radio-borderUnselected border colour
--nana-radio-bgCircle background
--nana-radio-sizeCircle diameter (overrides size preset)
PartDescription
controlThe clickable row
circleThe radio circle
labelThe label text
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Radio interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook