Skip to content
Album Card preview
Rendered from the SwiftUI source on this page.

Album Card

From syxUI — written for both platforms, not translated between them.

An album card.

Music · SwiftUI · iOS 17

  • music
  • swiftui

The actual source

MusicAlbum.swift
// Album Card · syxUI · https://syxui.dev/components/music-album
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

extension View {
    func muCard(_ w: CGFloat, _ pad: CGFloat = 16) -> some View {
        self.padding(pad).frame(width: w)
            .background(Color(.systemBackground), in: RoundedRectangle(cornerRadius: 20, style: .continuous))
            .overlay(RoundedRectangle(cornerRadius: 20, style: .continuous).stroke(Color.primary.opacity(0.06), lineWidth: 1))
            .shadow(color: .black.opacity(0.05), radius: 14, x: 0, y: 6)
    }
}

/// An album card.
struct MusicAlbum: View {
    var body: some View {
        VStack(alignment: .leading, spacing: 8) {
            Image("carAlbum").resizable().aspectRatio(contentMode: .fill).frame(width: 160, height: 160).clipShape(RoundedRectangle(cornerRadius: 14, style: .continuous)).shadow(color: .black.opacity(0.15), radius: 8, y: 4)
            VStack(alignment: .leading, spacing: 2) { Text("Liquid Dreams").font(.system(size: 15, weight: .bold)); Text("Aurora Waves · 2026").font(.system(size: 12)).foregroundStyle(.secondary) }
        }.muCard(200)
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17