Skip to Content

Radio

A brandless radio button. Uses appearance: none — the browser’s native rendering is fully removed. Radio buttons must share a name prop within a group for correct native browser behavior.

Usage

import { Radio } from '@froglet/ui' <Radio name="option-group" value="option1" checked={selectedValue === 'option1'} onChange={(e) => setSelectedValue(e.target.value)} />

Props

PropTypeDefaultDescription
checkedbooleanControlled checked state.
onChange(e: ChangeEvent<HTMLInputElement>) => void() => {}Callback fired when checked state changes.
classNamestringAdditional CSS classes. Use to apply a token block.
refReact.Ref<HTMLInputElement>Forwarded to the underlying <input>.
...propsInputHTMLAttributes<HTMLInputElement>All other native input attributes.

CSS Custom Properties

TokenDefaultDescription
--radio-size1remWidth and height.
--radio-border-width2pxBorder width.
--radio-border-stylesolidBorder style.
--radio-border-colorcurrentColorBorder color (unchecked).
--radio-border-radius50%Border radius (keep 50% for circle).
--radio-background-colortransparentBackground (unchecked).
--radio-border-color-hovercurrentColorBorder color on hover.
--radio-background-color-hovertransparentBackground on hover.
--radio-outline-width-focus2pxFocus ring width.
--radio-outline-color-focuscurrentColorFocus ring color.
--radio-outline-offset-focus2pxFocus ring offset.
--radio-border-color-checkedcurrentColorBorder color when checked.
--radio-background-color-checkedcurrentColorBackground when checked.
--radio-dot-color-checkedCanvasCenter dot color when checked.
--radio-border-color-disabledGrayTextBorder color when disabled.
--radio-background-color-disabledCanvasBackground when disabled.
--radio-dot-color-disabledGrayTextCenter dot color when disabled and checked.

Accessibility

  • Renders as a semantic <input type="radio"> with full keyboard and screen reader support.
  • Radio buttons within a group must share a name attribute.
  • Always associate a visible label using a <label> element or aria-label.
Last updated on