Cards
Cardsanimated
Mini Transport
Minimal transport card with previous, morphing play-pause and next buttons.
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 MiniTransport() {
var playing by remember { mutableStateOf(false) }
val scale by animateFloatAsState(
targetValue = if (playing) 1.1f else 1f,
animationSpec = spring(),
label = "pp",
)
Surface(
shape = RoundedCornerShape(28.dp),
tonalElevation = 3.dp,
modifier = Modifier.fillMaxWidth(),
) {
Row(
horizontalArrangement = Arrangement.spacedBy(
18.dp, Alignment.CenterHorizontally,
),
verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.padding(vertical = 14.dp),
) {
IconButton(onClick = {}) {
Icon(Icons.Default.SkipPrevious, contentDescription = null)
}
FilledIconButton(
onClick = { playing = !playing },
modifier = Modifier
.size(56.dp)
.graphicsLayer { scaleX = scale; scaleY = scale },
) {
Icon(
if (playing) Icons.Default.Pause
else Icons.Default.PlayArrow,
contentDescription = null,
)
}
IconButton(onClick = {}) {
Icon(Icons.Default.SkipNext, contentDescription = null)
}
}
}
}