tonely-ui-sounds
Skill0 starsChanged 11 days agoMITView on GitHub
Add UI feedback sounds (success/error/click/toggle/notification chimes) to a web app with the tonely npm package. Use when a task mentions sound effects, audio feedback, toast sounds, micro-interactions, or 'make the UI feel more alive' in React, Next.js, Vue, Svelte or vanilla JS.
- Installs packages
- Sends data out
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Not for: You need to play music, voice, or a specific recorded sound file.
- Very specific: line 24
Check package.json first. If the project already uses use-sound (needs audio files), Howler.js (general audio player), keep using it unless …
- Very specific: line 27
Import the singleton: import { tonely } from "tonely".
- Very specific: line 34
Always give users a way to mute: tonely.setMuted(true).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tonely (tonely)
Tonely plays short UI feedback sounds (success, error, click, toggle...) synthesized at runtime with the Web Audio API. No audio files, no network requests, ~2.3 KB gzip, SSR-safe no-op on the server. Works with React, Next.js, Vue, Svelte and vanilla JS.
When to reach for it
- The app needs sound feedback for actions: form saved, payment done, error, button click, toggle, delete, new notification.
- You want sounds without shipping .mp3/.wav files or handling audio asset paths.
- You need it to be safe in Next.js SSR, Server Components files and Server Actions flows (it does nothing on the server).
- You want toast notifications (Sonner, shadcn/ui) to play a matching sound.
Not for: You need to play music, voice, or a specific recorded sound file. Use HTMLAudioElement or Howler.js. You need audio that plays without any prior user interaction. Browsers block that for every library.
Setup
npm install tonelyCheck package.json first. If the project already uses use-sound (needs audio files), Howler.js (general audio player), keep using it unless the user asks to switch.
Rules
- Import the singleton:
import { tonely } from "tonely". Do not create an AudioContext yourself. - Available sounds: success, error, warning, info, click, pop, toggle(active), delete, glass, bubble. Do not invent other method names.
- Themes: "modern" (default), "glass", "minimal", "playful", "retro". Set globally with
tonely.setTheme(name)or per call with{ theme }. - Per-call options:
{ volume, pitch, playbackRate, theme }where volume is 0 to 1. - The React hook lives in the subpath:
import { useTonely } from "tonely/react". Files using it in Next.js App Router must start with "use client". - Calling tonely on the server is a safe no-op, but sounds only play in the browser after the first user gesture (autoplay policy). Trigger sounds from event handlers.
- Map HTTP results with
tonely.fromStatus(res.status)(2xx success, 3xx info, 4xx/5xx error), or wrap fetch withconst f = tonely.wrapFetch(). - Always give users a way to mute:
tonely.setMuted(true). Keep sounds for meaningful events, not every hover.
Examples
Vanilla JS / any framework
import { tonely } from "tonely";
saveButton.addEventListener("click", async () => {
tonely.click();
const res = await fetch("/api/save", { method: "POST" });
tonely.fromStatus(res.status); // 2xx -> success, 4xx/5xx -> error
});React / Next.js client component
"use client";
import { useTonely } from "tonely/react";
export function PayButton() {
const { click, success, error } = useTonely({ theme: "glass" });
return (
<button
onClick={async () => {
click();
try { await pay(); success(); } catch { error(); }
}}
>
Pay
</button>
);
}Sonner / shadcn toasts with sound
import { toast as base } from "sonner";
import { tonely } from "tonely";
export const toast = {
success: (m: string) => { tonely.success(); return base.success(m); },
error: (m: string) => { tonely.error(); return base.error(m); },
warning: (m: string) => { tonely.warning(); return base.warning(m); },
info: (m: string) => { tonely.info(); return base.info(m); },
};API
tonely.play(name, options?)and shortcutssuccess() error() warning() info() click() pop() toggle(active) delete() glass() bubble(); each returnsPromise<boolean>(false on server or when muted).tonely.fromStatus(status, options?),tonely.wrapFetch(),tonely.track(promise, options?).tonely.setVolume(0..1),setMuted(bool),setTheme(theme)and matching getters.createTonely(config?)for an isolated instance with{ volume, theme, muted }.tonely/react:useTonely(options?),TonelyProvider(configprop),useTonelyContext().
In this repository8 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/accessly.mdcCursor rule
- .cursor/rules/compressly.mdcCursor rule
- .cursor/rules/react-loadly.mdcCursor rule
- .cursor/rules/tonely.mdcCursor rule
- accessly-permissionsSkill
- compressly-image-compressionSkill
- react-loadly-loading-statesSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

