https://github.com/soub4i/react-spotifycode
React library for Spotify codes
https://github.com/soub4i/react-spotifycode
codes component props react scanable spotify
Last synced: 21 days ago
JSON representation
React library for Spotify codes
- Host: GitHub
- URL: https://github.com/soub4i/react-spotifycode
- Owner: soub4i
- Created: 2021-03-06T21:51:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-06T23:17:03.000Z (almost 5 years ago)
- Last Synced: 2025-09-26T21:57:17.438Z (5 months ago)
- Topics: codes, component, props, react, scanable, spotify
- Language: TypeScript
- Homepage:
- Size: 208 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @soubai/react-spotifycode
React library for Spotify codes
>Spotify Code is a QR-like “scannable” tag that can be used to quickly share or access a piece of content within Spotify
[](https://www.npmjs.com/package/@soubai/react-spotifycode) [](https://standardjs.com)
## Install
```bash
npm install --save @soubai/react-spotifycode
```
## Usage
```tsx
import React, { Component } from 'react'
import SpotifyCode from '@soubai/react-spotifycode'
class Example extends Component {
render() {
return (
)
}
}
```
## Props
The component accept a few props:
- **code**: The Spotify URI - **required**
- **format** The image format - 'jpeg' | 'png' | 'svg' - **default** : 'jpeg'
- **barColor**: Bar color - 'black' | 'white' - **default** : 'black'
- **backgroundColor**: The background color - **default** : '000' - **example** : '000' or '000000' for #000 color
- **size**: The image size on pixel - **default** : 640
## Development
Local development is broken into two parts (ideally using two tabs).
First, run rollup to watch your `src/` module and automatically recompile it into `dist/` whenever you make changes.
```bash
npm start # runs rollup with watch flag
```
The second part will be running the `example/` create-react-app that's linked to the local version of your module.
```bash
# (in another tab)
cd example
npm start # runs create-react-app dev server
```
## License
MIT © [AbderrahimSoubaiElidrissi](https://github.com/AbderrahimSoubaiElidrissi)