Skip to content
Components / Controls

Native radio group

The browser's own radios in a fieldset with a legend, for forms that must work without JavaScript and for swatch pickers.

@fabrials/ui
Loading state
Sort messages by

Installation

  1. Import the control from @fabrials/ui, after setting the app up.

    TypeScript
    import { NativeRadioGroup, NativeRadio } from "@fabrials/ui";

API reference

Prop / exportTypeDescription
legendReactNodeThe name of the group. Required.
hideLegendbooleanKeeps the legend for assistive technology and hides it.
layoutstack | gridgrid flows the options into columns that are never narrower than --fui-native-radio-min (9rem by default) and never wider than the group, so a narrow pane gets fewer columns, down to one.
--fui-native-radio-minlength (9rem)Custom property on the group (a style prop or a class): the narrowest a grid column may be, the radio and its gap included. Raise it (12rem) when the names are long; the pane then drops to fewer columns before a name wraps to three lines or a long word breaks.
NativeRadio labelReactNodeA whole-row label, a 44px target. name and value are the form's.
disabledbooleanOn the group it disables every native radio.

Behavior

The arrow keys move within a name group natively. A Base UI RadioGroup is spans that a disabled fieldset does not disable; use these when the form must submit natively.

Accessibility

Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.