solid-spotify-embed
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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

Package Sidebar

Install

npm i solid-spotify-embed

Weekly Downloads

2

Version

0.1.0

License

none

Unpacked Size

11.7 kB

Total Files

11

Last publish

Collaborators

  • jessyhq