Skip to content

Segmented Button

Overview

Segmented buttons allow users to toggle between multiple related options.

segmented buttons

Properties

namedescriptiontypedefault
segmentsRequired. The segments to display.ButtonSegment[]-
selectedRequired. Selected segment(s).T[]-
onSegmentPressRequired. Callback when a segment is pressed.(value: T[]((currValues: T[]) => T[])) => void
disabledWhether the segmented button is disabled.booleanfalse
multiSelectionEnabledWhether multiple segments can be selected.booleanfalse
withCheckmarkControls checkmark visibility in the selected segment.booleantrue
iconSizeSize of the segment icons in pixels.number18
iconColorColor of the segment icons.ColorValue-
rippleColorRipple effect color on segment press.ColorValue-
labelStyleStyle for the segment labels.TextStyle-

Button Segment

The Button Segment interface defines the structure of each segment in the segmented button.

typescript
export interface ButtonSegment<T, U> {
  value: T; // The value associated with the segment.
  label?: string; // Optional text label for the segment.
  Icon?: React.FC<U>; // Optional icon to display in the segment.
}