Skip to main content

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​

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,
)
NameTypeDefault
titleStringrequired
expandedBooleanrequired
onExpandedChange(Boolean) -> Unitrequired
modifierModifierModifier
subtitleString?null
leading(@Composable () -> Unit)?null
enabledBooleantrue
interactionSourceMutableInteractionSource?null
content@Composable ColumnScope.() -> Unitrequired
Design notes

Why CamoAccordion works this way, its states and its edge cases: contributor docs.