CamoListItem
One list row: up to three lines of text with a leading and a trailing slot. With onClick the whole row is one
target, announced as one element; without it the row is plain content, with no focus stop. For a settings row
with a switch, pass the switch display-only (onCheckedChange = null) as trailing and toggle in onClick:
the row is then announced as the switch ("Wi-Fi, switch, on").
API
- Kotlin
- Dart
public fun CamoListItem(
headline: String,
modifier: Modifier = Modifier,
supporting: String? = null,
overline: String? = null,
leading: (@Composable () -> Unit)? = null,
trailing: (@Composable () -> Unit)? = null,
onClick: (() -> Unit)? = null,
selected: Boolean = false,
enabled: Boolean = true,
interactionSource: MutableInteractionSource? = null,
)
| Name | Type | Default |
|---|---|---|
headline | String | required |
modifier | Modifier | Modifier |
supporting | String? | null |
overline | String? | null |
leading | (@Composable () -> Unit)? | null |
trailing | (@Composable () -> Unit)? | null |
onClick | (() -> Unit)? | null |
selected | Boolean | false |
enabled | Boolean | true |
interactionSource | MutableInteractionSource? | null |
Design notes
Why CamoListItem works this way, its states and its edge cases: contributor docs.