Skip to content
Buttons

ToneKey

One ivory piano key between two black ones. Each press dips the key and plays the next note, made live with Web Audio. No sound files.

Download
  • React
  • Tailwind CSS v4
  • motion

Props

NameTypeDefaultWhat it does
childrenReactNode—Label on the key.
onClick() => void—Click handler.
notesstring[]["C4", "E4", "G4", "C5"]Played in turn, one per press. Letter, optional #, octave.
mutedbooleanfalseKeeps the key silent.
classNamestringivory keySize and text. The ivory face stays.