sonance
v0.1.0
Published
Interaction sounds for the web. No audio files. No config. One import.
Readme
sonance
Interaction sounds for the web.
No audio files.
No audio CDN.
No configuration.
No setup.
Just sound — when things happen.
import { sonance } from "sonance";
sonance.play("confirm");Why
Most interfaces are silent.
Buttons click in silence.
Forms submit in silence.
Destructive actions happen in silence.
Users shouldn’t have to stare at the screen to know something worked.
Sound is feedback.
Feedback builds confidence.
Install
npm install sonanceUsage
Import it.
Call it.
import { sonance } from "sonance";
// async action
try {
await submit();
sonance.play("success");
} catch {
sonance.play("error");
}
// button click
button.addEventListener("click", () => {
sonance.play("click");
});
// destructive action
sonance.play("destroy");
// stop current sound
sonance.stop();That’s it.
No providers.
No wrappers.
No framework adapters.
Works anywhere JavaScript runs in the browser.
Sounds
| name | when to use |
| --------------- | ----------------------------- |
| confirm | primary action |
| success | async completed |
| saved | auto-save |
| sent | message delivered |
| complete | multi-step flow finished |
| error | something failed |
| criticalError | system-level failure |
| denied | permission refused |
| warn | proceed with caution |
| click | button press |
| softClick | checkbox, minor action |
| hover | important interactive element |
| toggle | switch turned on |
| destroy | delete, irreversible action |
| countdown | deadline approaching |
Minimal.
Short.
Clear.
How It Works
Built on the Web Audio API.
Everything is generated at runtime:
- Oscillators
- Frequency sweeps
- Gain envelopes
No files fetched.
No decoding.
Nothing hosted.
Execution time: under 1ms.
Bundle size: ~1kb gzipped.
Contributing
- Add a sound in
src/sounds/ - Add the name to
SoundNameinsrc/types.ts - Register it in
src/sounds/index.ts - Open a PR
Open the playground.
If it sounds right, it is right.
License
MIT © 2026 Your Name
