Piano
Customizable piano component.
SourceImport
import { noteNumber, noteName } from '@tremolo-ui/functions'
import {
BlackKey,
KeyLabel,
Piano,
SHORTCUTS,
WhiteKey
} from '@tremolo-ui/react'
Examples
Basic
Loading...
function App() { return ( <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', }} > <Piano noteRange={{ first: noteNumber('C3'), last: noteNumber('B4') }} keyboardShortcuts={SHORTCUTS.HOME_ROW} // Notice: need optional chaining (?.) label={(_, i) => SHORTCUTS.HOME_ROW.keys[i]?.toUpperCase()} /> </div> ) }