GitHub

Radio Group

Group of radio buttons for single selection

Basic Usage

Loading...

Installation

pnpm add @corew500/ui

Usage

import { RadioGroup } from "@corew500/ui/radio-group"

<RadioGroup>Content</RadioGroup>

Variants

radioItemVariants

AxisValuesDefault
size
smdefaultlg
default

radioIndicatorVariants

AxisValuesDefault
size
smdefaultlg
default

radioIconVariants

AxisValuesDefault
size
smdefaultlg
default

CMS Integration

CMSPayload CMS Integration
This component supports CMS-driven content via @corew500/cms-payload.
Loading...

API Reference

Props

PropTypeDefaultDescription
disabledenumfalseWhether the component should ignore user interaction.
readOnlyenumfalseWhether the user should be unable to select a different radio button in the group.
requiredenumfalseWhether the user must choose a value before submitting a form.
namestringIdentifies the field when a form is submitted.
valueanyThe controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the `defaultValue` prop instead.
defaultValueanyThe uncontrolled value of the radio button that should be initially selected. To render a controlled radio group, use the `value` prop instead.
onValueChange(value: any, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element; }) => voidCallback fired when the value changes.
inputRefenumA ref to access the hidden input element.
classNameenumCSS class applied to the element, or a function that returns a class based on the component’s state.
styleenumStyle applied to the element, or a function that returns a style object based on the component’s state.
renderenumAllows you to replace the component’s HTML element with a different tag, or compose it with another component. Accepts a `ReactElement` or a function that returns the element to render.

Accessibility

Keyboard Navigation

  • - Full keyboard navigation: Arrow keys to move between options
  • Space to select the focused option
  • Tab moves focus to/from the group, not between items
  • Focus visible ring for keyboard navigation

Screen Readers

  • ARIA radio group semantics handled by Base UI
  • Invalid state announced via `aria-invalid`

Localization

Translatable Content

  • - Labels should be provided externally via `FieldLabel` components
  • All visible text should be pre-translated

Related

Related Components