Compose Modifier

basicMarquee

Applies an animated marquee effect to the modified content if it's too wide to fit in the available space.

BasicMarqueeSample

@Preview(showBackground = true)
@Sampled
@Composable
fun BasicMarqueeSample() {
    // Marquee only animates when the content doesn't fit in the max width.
    Column(Modifier.width(30.dp)) { Text("hello world", Modifier.basicMarquee()) }
}

BasicMarqueeWithFadedEdgesSample

@Preview(showBackground = true)
@Sampled
@Composable
fun BasicMarqueeWithFadedEdgesSample() {
    val edgeWidth = 32.dp

BasicFocusableMarqueeSample

@Preview(showBackground = true)
@Sampled
@Composable
fun BasicFocusableMarqueeSample() {
    val focusRequester = remember { FocusRequester() }

    // Marquee only animates when the content doesn't fit in the max width.
    Column(Modifier.width(30.dp)) {
        Text(
            "hello world",
            Modifier.clickable { focusRequester.requestFocus() }
                .basicMarquee(animationMode = MarqueeAnimationMode.WhileFocused)
                .focusRequester(focusRequester)
                .focusable(),
        )
    }
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: