Label

@Composable
fun Label(label: @Composable TooltipScope.() -> Unit, modifier: Modifier = Modifier, interactionSource: MutableInteractionSource? = null, isPersistent: Boolean = false, content: @Composable () -> Unit)

Label component that will append a label to content. The positioning logic uses TooltipDefaults.rememberPlainTooltipPositionProvider.

Label appended to thumbs of Slider:

Parameters

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.

Samples

androidx.compose.material3.samples.SliderWithCustomThumbSampleandroidx.compose.material3.samples.RangeSliderWithCustomComponents