Scale
The <Scale> React component renders guitar scale diagrams.
Installation
pnpm add @music-ui/reactUsage
The following code renders the C major scale all over the fretboard:
import { Scale } from "@music-ui/react";
function App() {
return (
<main>
<h1>My App</h1>
{/* rest of your app */}
<Scale root="C" type="major" />
</main>
);
}Output:
Component props
In addition to the Fretboard component props, the component accepts the following props:
| Name | Type | Default Value | Description |
|---|---|---|---|
root | string | The scale root note (e.g. “C”) | |
type | string | The scale type (e.g. “major”) | |
showName | boolean | false | Shows the scale name |
textProperty | "note" | "degree" | "interval" | The position property to display | |
highlightDegree | number | undefined | Highlights the passed degree |
className | string | scale | The component class name |
Props showcase
A showcase of the component props:
import { Scale } from "@music-ui/react";
function App() {
return (
<>
<Scale root="G" type="dorian" showName />
<Scale root="E" type="blues" textProperty="note" highlightDegree={1} />
<Scale
root="C"
type="major"
box={{ system: "CAGED", box: "G" }}
displayBoxOnly
highlightDegree={1}
/>
</>
);
}showName = true
textProperty and highlightDegree
box and displayBoxOnly and highlightDegree
Last updated on