react-music-score

A music score editor component for React using Vexflow and MusicXML

Usage no npm install needed!

<script type="module">
  import reactMusicScore from 'https://cdn.skypack.dev/react-music-score';
</script>

README

react-music-score

A music score editor component for React using Vexflow and MusicXML

Cypress NPM JavaScript Style Guide

Install

npm install --save react-music-score

Usage

import React, { Component } from 'react';

import ScoreEditor from 'react-music-score';
import 'react-music-score/dist/index.css';

class Example extends Component {
  render() {
    return <ScoreEditor />;
  }
}

Using this with Next.js? Because of the Vexflow dependency not working in Node.js, you need to dynamically import this component, to prevent SSR

import dynamic from "next/dynamic";

const ScoreEditor = dynamic(() =>
  import("react-music-score")
    .then((mod) => mod.ScoreEditor)
    .catch((e) => {
      // will throw server side - ignore this
      return null;
    })
);

....

License

MIT © Caesura