Cards
Cardsanimated
Buffered Scrubber
Track scrubber card showing buffered range, played position and time labels.
Installation
caveui components are copy-paste Jetpack Compose built entirely on Material 3 — there's no caveui dependency to add. Make sure Material 3 is on your classpath (it ships with the Compose BOM), then copy the Usage snippet below into your project.
kotlin
// build.gradle.kts (module)
dependencies {
implementation(platform("androidx.compose:compose-bom:2025.06.00"))
implementation("androidx.compose.material3:material3")
}Usage
kotlin
@Composable
fun BufferedScrubber() {
val played by animateFloatAsState(
targetValue = 0.4f,
animationSpec = tween(700),
label = "p",
)
val buffered = 0.72f
Card(
shape = RoundedCornerShape(18.dp),
modifier = Modifier.fillMaxWidth(),
) {
Column(Modifier.padding(16.dp)) {
Text("Episode 12 — Signals",
style = MaterialTheme.typography.titleSmall)
Spacer(Modifier.height(14.dp))
Box(
modifier = Modifier
.fillMaxWidth()
.height(6.dp)
.clip(RoundedCornerShape(3.dp))
.background(MaterialTheme.colorScheme.surfaceVariant),
) {
Box(
Modifier
.fillMaxWidth(buffered)
.fillMaxHeight()
.background(
MaterialTheme.colorScheme.primary
.copy(alpha = 0.35f),
),
)
Box(
Modifier
.fillMaxWidth(played)
.fillMaxHeight()
.background(MaterialTheme.colorScheme.primary),
)
}
Spacer(Modifier.height(8.dp))
Row(
Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
) {
Text("12:40",
style = MaterialTheme.typography.labelSmall)
Text("-18:05",
style = MaterialTheme.typography.labelSmall)
}
}
}
}