Skip to content

Segmented Control

A customizable segmented control widget for selecting between multiple options.

The SegmentedControl widget creates a horizontal row of selectable segments with different layout types. It supports customizable appearance and selection handling, making it perfect for tab-like interfaces, filter options, or multi-choice selections.

  • Customizable Appearance: Colors, border radius, padding, and typography
  • Interactive States: Selected and unselected states with smooth transitions
  • Theme Support: Automatically adapts to light and dark themes

A simple two-option segmented control.


A three-option segmented control for more choices.


A four-option segmented control.


A five-option segmented control for maximum choices.


PropertyTypeDescription
segmentsListThe list of segment data to display.
selectedIndexintThe index of the currently selected segment.
onSelectionChangedValueChanged<int>?Callback function called when selection changes. Receives the selected index.
heightdoubleThe height of the segmented control.
borderRadiusBorderRadiusGeometry?The border radius to apply to the control.
backgroundColorColor?The background color of the control. Uses theme-appropriate default if null.
selectedColorColor?The color of the selected segment. Defaults to white.
unselectedTextColorColor?The text color for unselected segments. Uses theme-appropriate default if null.
selectedTextColorColor?The text color for the selected segment. Uses theme-appropriate default if null.
paddingEdgeInsetsGeometryThe padding around the entire control.
segmentPaddingEdgeInsetsGeometry?The padding inside each segment. Optional.