Overview
SegmentedControl is a preset assembled from Radio and RadioGroup, with joined options. Use it for a short, mutually exclusive choice. For navigation between content panels, use Tabs.
Usage
Supply an accessible group name witharia-label or aria-labelledby. Each option needs a unique string value. Selection belongs to the group; options do not have independent checked state.
defaultValue initializes selection. The group owns later changes. Add onValueChange if you need to observe them without controlling the value.
Controlled state
value in application state and update it in onValueChange. Do not combine value and defaultValue or switch ownership modes after mounting.
Icon options
aria-label. startIcon is decorative and hidden from assistive technology. Options with visible text use label and may also provide startIcon. Set disabled on an option to prevent its selection, or on the group to disable every option.
Keyboard, forms, and direction
Tab enters the group; arrow keys move between enabled options and update selection. This follows radio behavior. Dropdown selection groups move focus with arrow keys and select on activation.itemWidth="equal" is the default; use content when labels should determine widths. Set name to include the selected value in native form submission. The preset preserves RadioGroup’s required, readOnly, disabled state, and native form integration. onValueChange receives the selected value and Base UI event details, including reason and cancel().
For right-to-left content, pair DirectionProvider with a matching dir attribute. The provider controls directional interaction; dir controls the document layout.
Composition and native props
Native props,className, style, render, and ref target the group’s div. Use render to compose that group with another element; preserve its accessible name and radio-group semantics. Options render span elements with role="radio" and hidden native radio inputs. The preset does not assign tab or tab-panel roles. For custom radio content, per-option native props, or a different radio render target, compose Radio.Root and RadioGroup directly.
Props
CSS class applied to the element, or a function that
returns a class based on the component’s state.
The uncontrolled value of the radio button that should be initially selected.To render a controlled radio group, use the
value prop instead.Identifies the form that owns the radio inputs.
Useful when the radio group is rendered outside the form.
((value: TValue, eventDetails: { reason: "none"; event: Event; cancel: () => void; allowPropagation: () => void; isCanceled: boolean; isPropagationAllowed: boolean; trigger: Element | undefined; }) => void)
Callback fired when the value changes.
Options with a unique string
value, a label or startIcon, and optional disabled. Icon-only options require an aria-label.Whether the user should be unable to select a different radio button in the group.
ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, RadioGroupState>
Allows 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.Style applied to the element, or a function that
returns a style object based on the component’s state.
The controlled value of the radio item that should be currently selected.To render an uncontrolled radio group, use the
defaultValue prop instead.