react-chord-svg
TypeScript icon, indicating that this package has built-in type declarations

1.4.2 • Public • Published

React Chord SVG

React component to generate chord diagram SVGs

Minified Size

Chord

Install

yarn add react-chord-svg
npm install react-chord-svg --save

Usage

import ChordSVG from "react-chord-svg";

<ChordSVG
  title="C Major - G Shape"
  startAtFret={5}
  numberOfFrets={5}
  notes={[
    {
      string: 1,
      muted: true,
    },
    {
      string: 2,
      muted: true,
    },
    {
      fret: 1,
      string: 3,
      bar: 4,
      color: "gray",
      opacity: 0.5,
    },
    {
      fret: 1,
      string: 3,
      text: "1",
    },
    {
      fret: 1,
      string: 4,
      text: "1",
      color: "red",
    },
    {
      fret: 1,
      string: 5,
      text: "1",
    },
    {
      fret: 4,
      string: 6,
      text: "4",
      color: "red",
    },
  ]}
/>;

Options

interface Props extends SVGProps<SVGSVGElement> {
  notes: Note[];
  title?: string;
  startAtFret?: number;
  numberOfFrets?: number;
  numberOfStrings?: number;
}

interface Note {
  bar?: number;
  fret?: number;
  text?: string;
  string: number;
  color?: string;
  muted?: boolean;
  opacity?: number;
  textColor?: string;
}

Package Sidebar

Install

npm i react-chord-svg

Weekly Downloads

1

Version

1.4.2

License

none

Unpacked Size

27.2 kB

Total Files

28

Last publish

Collaborators

  • stuart-williams