SegmentedControlScope
DSL scope for declaring segments inside a SegmentedControl content block.
Each function adds one segment in declaration order. The return type SegmentedButtonItem is a marker; callers discard it. All variants animate label weight and colour between the selected and unselected states; icons additionally animate between com.adevinta.spark.tokens.SparkColors.support (unselected) and com.adevinta.spark.tokens.SparkColors.supportVariant (selected).
Enabled state and indicator shape are inherited from the enclosing SegmentedControl and cannot be overridden per segment.
Functions
Segment with fully custom content. Use this when no other scope variant fits — for example, when segment appearance must vary with the selected value (e.g. a colour-coded energy-rating scale).
Segment showing an integer label. Equivalent to singleLine with number converted to a string. Useful for compact numeric scales (e.g. ratings 1–5).
Segment showing a single line of text, truncated with ellipsis when the segment is too narrow.