CamoTabs
A bar of tabs ("Overview / Reviews / Specs"): selected in, onSelect out, an animated indicator under the
selected tab, one Tab stop with the arrow keys moving and selecting, announced "Reviews, tab, 2 of 3". Fixed
tabs share the width; with scrollable they keep their natural width, the row scrolls and the selection stays
in view. The content below is the app's layout; rememberCamoTabsPagerSync keeps a pager in step. Pass the
sync's position as indicatorPosition to make the indicator follow a swipe.
API
- Kotlin
- Dart
public fun <T> CamoTabs(
selected: T,
onSelect: (T) -> Unit,
tabs: List<CamoTab<T>>,
modifier: Modifier = Modifier,
scrollable: Boolean = false,
appearance: Appearance? = null,
indicatorPosition: (() -> Float)? = null,
)
| Name | Type | Default |
|---|---|---|
selected | T | required |
onSelect | (T) -> Unit | required |
tabs | List<CamoTab<T>> | required |
modifier | Modifier | Modifier |
scrollable | Boolean | false |
appearance | Appearance? | null |
indicatorPosition | (() -> Float)? | null |
Design notes
Why CamoTabs works this way, its states and its edge cases: contributor docs.