Button Sounds: Tactile Click and Switch Sounds for UI πŸŽ›πŸ”Š
← Go back

Button Sounds: Tactile Click and Switch Sounds for UI πŸŽ›πŸ”Š

Josh W. Comeau’s free Button Sounds library: 50+ studio-recorded physical button sounds with multisampling and a lightweight JS/React package.

Button Sounds: Tactile Click and Switch Sounds for UI πŸŽ›πŸ”Š

Josh W. Comeau has released a great free library called Button Soundsβ€”a collection of 50+ studio-recorded sounds of physical buttons, mechanical keyboard switches, gamepads, mice, and toggle switches, complete with a ready-to-use JS/React package for the web.

Usually, UI sound effects sound cheap and get annoying fast because the exact same β€œflat” sample plays on every click. In the real world, a button never sounds the same twiceβ€”and Josh solved this with multisampling:

  • Lifelike variation: each of the 50+ sounds includes 8 to 16 individual samples (recorded separately for press and release). On every click, the library picks a random take, and you can add subtle pitch randomization (pitchVariation)β€”making clicks feel organic and tactile.
  • Minimal code and footprint: the core button-sounds package is only ~3 KB gzipped (lazily loading howler at ~10 KB under the hood). Audio sprites are fetched from the jsDelivr CDN by default only for the sounds you actually use (though you can also download the MP3 or lossless WAV files and self-host them).
  • Simple API and React hooks: to get started quickly, just call wireUp(button, 'hi75-soft')β€”it preloads the sound and cleanly handles press and release events (even if the pointer leaves the button before release). For React, useButtonSounds and useImperativeButtonSounds hooks are included out of the box.
  • Easter eggs for geeks: a built-in lofi mode with a bitcrusher for a crunchy 8-bit NES-style sound, plus a hidden mini-game on the project page that rewards a discount on the author’s courses.

πŸ‘‰ Try the interactive playground and read the docs: buttons.joshwcomeau.com (opens in new tab)

How do you feel about audio feedback in web interfaces? A nice touch for micro-interactions, or should any web sound without an explicit player be an instant no? πŸ‘‡

Copied