StylishSegmentedOption

data class StylishSegmentedOption<T>(val value: T, val label: String, val enabled: Boolean = true, val leadingContent: @Composable RowScope.() -> Unit? = null, val trailingContent: @Composable RowScope.() -> Unit? = null)

Immutable data describing a single option within a Segmented Button control.

A Segmented Button presents a set of mutually exclusive (or multi-select) options in a horizontal strip with connected corner geometry. Each option is represented by one instance of this class. The generic type T allows callers to associate arbitrary domain values (e.g. an enum constant or a route ID) with each segment.

Type Parameters

T

The type of the domain value this option represents.

See also

Constructors

Link copied to clipboard
constructor(value: T, label: String, enabled: Boolean = true, leadingContent: @Composable RowScope.() -> Unit? = null, trailingContent: @Composable RowScope.() -> Unit? = null)

Properties

Link copied to clipboard

Whether this segment is enabled. When false, the segment is visually dimmed and does not respond to interaction.

Link copied to clipboard

The text displayed on the segment.

Link copied to clipboard

Optional composable slot rendered before label (e.g. an icon). Receives RowScope for alignment control. null omits the slot.

Link copied to clipboard

Optional composable slot rendered after label (e.g. a badge). Receives RowScope for alignment control. null omits the slot.

Link copied to clipboard
val value: T

The domain value associated with this option. The consuming composable compares value against the current selection to determine the selected state.