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
Installation
Import the control from
@fabrials/ui, after setting the app up.TypeScript import { NativeRadioGroup, NativeRadio } from "@fabrials/ui";
API reference
| Prop / export | Type | Description |
|---|---|---|
legend | ReactNode | The name of the group. Required. |
hideLegend | boolean | Keeps the legend for assistive technology and hides it. |
layout | stack | grid | grid 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-min | length (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 label | ReactNode | A whole-row label, a 44px target. name and value are the form's. |
disabled | boolean | On 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.