components / album-art

album-art.

square cover tile with a real fallback state — expired cdn links and art-less tracks are the norm in music apis, so onError swaps to a disc glyph without changing the tile's footprint. pass an array of urls for a playlist mosaic (halves, half-plus-quarters, or a grid), and bleed to throw the cover's colour onto the page behind it.

cover, size xs
xs
cover, size sm
sm
cover, size md
md
cover, size lg
lg
fallback
broken cover
404 → fallback
cover with bleed
bleed
playlist of 2
mosaic · 2
playlist of 3
mosaic · 3
playlist of 4
mosaic · 4
installation
bunx @justin06lee/chrome@latest add album-art
props
nametypedefaultdescription
srcstring | string[]-cover url; omit or let it fail and the fallback takes over. an array is a mosaic — up to four covers laid out so the tile is always fully filled.
altstring''describe the record, not the picture.
size'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full''md''full' fills the container as a square.
bleedbooleanfalseblurred copy of the art behind the tile; only reads at lg and up.
fallbackReactNode-node shown when there is no art.
onClick() => void-renders the tile as a button.
hrefstring-renders the tile as a link.
linkComponentReact.ElementType-anchor component for internal hrefs (e.g. next/link).
overlayReactNode-drawn on top of the art — a play button, a hover scrim.
classNamestring-