This library is not production-ready yet. Developers should use it with caution and expect breaking changes.

Music Disc

Rotating music disc with floating notes animation for map locations.

Installation

First, make sure you have the base map component installed:

npx shadcn@latest add https://www.terrae.dev/map.json

Then install the music disc component:

npx shadcn@latest add https://www.terrae.dev/music-disc.json

With Album Cover

Add a custom album cover image using the image prop. The image will be displayed in the center of the disc.

Custom Colors

Customize the disc appearance with discColor, centerColor, and noteColor props. Adjust the spin speed with spinDuration (in milliseconds).

Static Mode

Disable the spinning animation with spinning=false and hide the floating notes with showNotes=false for a static vinyl record appearance.

Flat on Map

Use pitchAlignment="map" to make the disc lay flat on the map surface when the map is tilted. The default "viewport" keeps it always facing the screen.

Properties

PropertyTypeDefaultDescription
coordinates[number, number]requiredMap coordinates [longitude, latitude]
sizenumber64Disc size in pixels
imagestring-Album cover image URL
spinningbooleantrueEnable disc rotation
spinDurationnumber4000Full rotation duration in milliseconds
showNotesbooleantrueShow floating music notes
noteColorstring#a855f7Color of floating music notes
discColorstring#0a0a0aMain disc background color
centerColorstring#171717Center label area color
pitchAlignment"map" | "viewport" | "auto""viewport"How disc aligns when map is pitched. "viewport" keeps it upright, "map" lays it flat
classNamestring-Additional CSS classes

Use Cases

Music Venues

Show concert venues, music stores, or recording studios on the map

Audio Tours

Indicate audio playback points on interactive tour maps