Cards
Cards

Recently Played

Horizontal recently-played strip with rounded covers and timestamp labels.

Recently Played
2h ago
2h ago
2h ago

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 RecentlyPlayed(items: List<String>) {
  Card(
    shape = RoundedCornerShape(20.dp),
    modifier = Modifier.fillMaxWidth(),
  ) {
    Column(Modifier.padding(16.dp)) {
      Row(verticalAlignment = Alignment.CenterVertically) {
        Icon(Icons.Default.Schedule, contentDescription = null)
        Spacer(Modifier.width(8.dp))
        Text("Recently Played",
          style = MaterialTheme.typography.titleMedium)
      }
      Spacer(Modifier.height(12.dp))
      Row(
        horizontalArrangement = Arrangement.spacedBy(12.dp),
        modifier = Modifier.horizontalScroll(rememberScrollState()),
      ) {
        items.forEachIndexed { i, label ->
          Column {
            Box(
              modifier = Modifier
                .size(72.dp)
                .clip(RoundedCornerShape(14.dp))
                .background(
                  Brush.linearGradient(
                    listOf(
                      Color(0xFF6366F1),
                      Color(0xFFA855F7),
                    ),
                  ),
                ),
            )
            Spacer(Modifier.height(6.dp))
            Text(label,
              style = MaterialTheme.typography.labelSmall)
          }
        }
      }
    }
  }
}