0.1.0 • Published 7 months ago

solid-spotify-embed v0.1.0

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

solid-spotify-embed

npm npm version npm downloads sponsors

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).

Inspiration

Inspired by the battle-tested and original react-spotify-embed.

Installation

npm i solid-spotify-embed

yarn add solid-spotify-embed

Usage

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 }
    >
  )
}

License

MIT

0.1.0

7 months ago