Skip to main content

CamoFab

The screen's one main action: an icon button, or an extended FAB with a text label. The accessible name is the text when there is one and contentDescription otherwise, in both states, so collapsing it while the list scrolls (expanded = false) doesn't rename it. visible = false scales it out and takes it out of the tree, so a hidden FAB can't be focused (pair it with rememberHideOnScroll). Placement is the app's layout.

API​

public fun CamoFab(
icon: @Composable () -> Unit,
contentDescription: String,
onClick: () -> Unit,
modifier: Modifier = Modifier,
text: String? = null,
expanded: Boolean = true,
visible: Boolean = true,
appearance: Appearance? = null,
tone: Tone = Tone.Default,
interactionSource: MutableInteractionSource? = null,
)
NameTypeDefault
icon@Composable () -> Unitrequired
contentDescriptionStringrequired
onClick() -> Unitrequired
modifierModifierModifier
textString?null
expandedBooleantrue
visibleBooleantrue
appearanceAppearance?null
toneToneTone.Default
interactionSourceMutableInteractionSource?null
Design notes

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