CamoAccordion
An expandable section (an FAQ answer, a "Shipping" panel). It's controlled: the app owns expanded. The
header is a button and a heading, announced "Shipping, collapsed". Collapsed content stays composed, keeping
its state (a half-filled form), but takes no space and is neither focusable nor announced.
API
- Kotlin
- Dart
public fun CamoAccordion(
title: String,
expanded: Boolean,
onExpandedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier,
subtitle: String? = null,
leading: (@Composable () -> Unit)? = null,
enabled: Boolean = true,
interactionSource: MutableInteractionSource? = null,
content: @Composable ColumnScope.() -> Unit,
)
| Name | Type | Default |
|---|---|---|
title | String | required |
expanded | Boolean | required |
onExpandedChange | (Boolean) -> Unit | required |
modifier | Modifier | Modifier |
subtitle | String? | null |
leading | (@Composable () -> Unit)? | null |
enabled | Boolean | true |
interactionSource | MutableInteractionSource? | null |
content | @Composable ColumnScope.() -> Unit | required |
Design notes
Why CamoAccordion works this way, its states and its edge cases: contributor docs.