Use this component to create a Spotify embed for a given Spotify link. In Spotify, click ••• > Copy Link, and paste it in the prop.
Any link should work (albums, songs, etc.). All other props on the Spotify embed widget can also be overridden (see here).
Inspired by the battle-tested and original react-spotify-embed.
npm i solid-spotify-embed
yarn add solid-spotify-embed
import type { Component } from 'solid-js'
import Spotify from 'solid-spotify-embed'
const App: Component = () => {
return (
<div>
<Spotify link="https://open.spotify.com/track/5ihDGnhQgMA0F0tk9fNLlA?si=4472348a63dd4f83" />
<Spotify link="https://open.spotify.com/album/0fUy6IdLHDpGNwavIlhEsl?si=mTiITmlHQpaGkoivGTv8Jw" />
<Spotify wide link="https://open.spotify.com/track/5ihDGnhQgMA0F0tk9fNLlA?si=4472348a63dd4f83" />
</div>
)
}
The <Spotify>
component is completely customizable. Check out the following code:
import type { Component } from 'solid-js'
import Spotify from 'solid-spotify-embed'
const CustomSpotify: Component = () => {
return (
<Spotify
wide={false}
width='420px'
height='69px'
frameBorder='10px'
allow='encrypted-media'
{ ...props }
>
)
}
MIT