ui-sounds

Automatic audio feedback for every UI action. Three themes, zero dependencies.

GitHub

Install

$ npm i ui-sounds
$ pnpm add ui-sounds
$ yarn add ui-sounds
$ bun add ui-sounds
<script src="https://cdn.jsdelivr.net/npm/ui-sounds/dist/index.global.js"></script>
$ npx skills add buburdin/ui-sounds

Usage

import { useUISound } from 'ui-sounds/react'; function App() { const { play } = useUISound('playful'); return ( <button onClick={() => play('click')}> Save </button> ); }
import { playSound, setVolume } from 'ui-sounds'; // Play a sound with any theme playSound('click', 'minimal'); playSound('success', 'playful'); playSound('error', 'futuristic'); // Control volume setVolume(0.3);
<script setup> import { useUISound } from 'ui-sounds/vue'; const { play } = useUISound('calm'); </script> <template> <button @click="play('click')">Save</button> </template>
<script> import { createUISound } from 'ui-sounds/svelte'; import { onDestroy } from 'svelte'; const { play, destroy } = createUISound('natural'); onDestroy(destroy); </script> <button on:click={() => play('click')}>Save</button>

Sound reference

ActionSoundDuration
clickShort percussive tap30–120ms
navigationFrequency sweep / whoosh80–450ms
successAscending tone100–300ms
errorVibrato alert150–600ms
loadingRepeating pulse20–200ms
hoverSubtle presence15–45ms
deleteDescending warning80–300ms