Read page as text

NIB / DOCUMENTATION

Radio group — NibComponents

Choose exactly one option with native-style arrow-key selection.

Open interactive view

Model one choice with a typed value

options and value are required. value can be null before a choice is made. Each NibRadioOption has a typed value and label; equality selects the matching option. onChanged emits the new value. A radio option already selected does not clear itself when pressed again.

Describe and disable individual options

NibRadioOption supports description, leading, and disabled. The Instant fixture is disabled while Daily and Weekly remain usable. Group disabled or null onChanged disables every option. Avoid duplicate option values because selection is based on equality.

Arrows select as they move focus

The group uses one tab stop. Arrow keys move and select among enabled options, wrapping past the ends; Space and Enter select the focused option. This differs from the toggle group, whose arrows move focus without selecting. Give the group a semanticLabel that describes the decision.

Lay out options or replace their content

direction defaults to Axis.vertical. Horizontal groups wrap at narrow widths. spacing defaults to 12 and dotSize to 20. optionBuilder receives context, NibRadioOption, selected, and disabled. Return the row content; the group keeps tap, focus, keyboard, and ripple behavior. The Cards option in this preview exercises that callback.

Keep selection independent of animation

animated: true pops the selected dot. The static default retains selection and keyboard behavior. transition can change that feedback. Custom optionBuilder content replaces the default dot and therefore controls its own visual selection state.

Selection is missing or focus skips an option

Ensure value matches an option using the same type and equality semantics. A disabled option is intentionally skipped by keyboard navigation. Update the parent value in onChanged; creating a separate controller is unnecessary because this API has none.