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
- Kotlin
- Dart
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,
)
| Name | Type | Default |
|---|---|---|
icon | @Composable () -> Unit | required |
contentDescription | String | required |
onClick | () -> Unit | required |
modifier | Modifier | Modifier |
text | String? | null |
expanded | Boolean | true |
visible | Boolean | true |
appearance | Appearance? | null |
tone | Tone | Tone.Default |
interactionSource | MutableInteractionSource? | null |
Design notes
Why CamoFab works this way, its states and its edge cases: contributor docs.