← Back to Material 3 Compose
Label
Component
in
Material 3
. Since 1.2.0-alpha09Overview
Code Examples
Label component that will append a label to content. The positioning logic uses TooltipDefaults.rememberPlainTooltipPositionProvider.
Label appended to thumbs of Slider:
Overloads
Label
@ExperimentalMaterial3Api
@Composable
fun Label(
label: @Composable () -> Unit,
modifier: Modifier = Modifier,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
isPersistent: Boolean = false,
content: @Composable () -> Unit
)
Parameters
Name | Description |
---|---|
label | composable that will be appended to content |
modifier | Modifier that will be applied to content |
interactionSource | the MutableInteractionSource representing the stream of Interactions for the content. |
isPersistent | boolean to determine if the label should be persistent. If true, then the label will always show and be anchored to content. if false, then the label will only show when pressing down or hovering over the content. |
content | the composable that label will anchor to |