KMarquee

fun KMarquee(modifier: Modifier = Modifier, direction: KMarqueeDirection = KMarqueeDirection.FORWARD, velocity: Dp = KMarqueeDefaults.Velocity, spacing: Dp = KMarqueeDefaults.Spacing, repeatCount: Int = 4, pauseOnTouch: Boolean = true, enableFadeEdges: Boolean = true, fadeColor: Color = Color.Unspecified, fadeWidth: Dp = KMarqueeDefaults.FadeWidth, content: @Composable () -> Unit)(source)

A seamless infinite scrolling marquee container.

This component scrolls its content continuously in a specified direction. It is ideal for tickers, news feeds, or showcasing a list of logos/items that should loop forever.

Example usage:

KMarquee(
direction = KMarqueeDirection.FORWARD,
velocity = 40.dp,
spacing = 20.dp
) {
Row(verticalAlignment = Alignment.CenterVertically) {
repeat(10) { index ->
Text("Item $index", modifier = Modifier.padding(horizontal = 8.dp))
Icon(Icons.Default.Star, null)
}
}
}

Parameters

modifier

Applied to the outer layout wrapper.

direction

Controls the scroll direction (KMarqueeDirection.FORWARD or KMarqueeDirection.BACKWARD).

velocity

Base speed in Dp per second.

spacing

Minimum gap between duplicate items during loop.

repeatCount

Number of item duplicates to render to guarantee continuous coverage.

pauseOnTouch

Pauses animation when user holds down/taps the component.

enableFadeEdges

Renders soft gradient fades at start and end edges.

fadeColor

Color for the edge fade gradients (typically matches screen background).

fadeWidth

Width of the edge fade gradient overlays.

content

Slot layout to render inside the ticker.