cuelume logo

cuelume

Cuelume is a curated sound palette, not an audio engine. It gives buttons, links, toggles, and completed actions clear feedback without asking developers to design sounds themselves. Add an attribute, call bind(), done.

Developer ToolsTypeScriptMIT 951 29Health 82
Website GitHub

What is it?

What it is

Cuelume is a curated palette of fourteen interaction sounds for the web, synthesized live with the Web Audio API and delivered as a zero‑dependency ESM module.

Why it exists

To give developers instant, polished audio feedback for UI interactions (hover, press, release, toggle, success, etc.) without requiring them to design or host sound files, keeping bundles tiny and integration trivial.

Who should use it

Frontend developersUI/UX designers with coding skillsWeb application developersCreative technologists

Who should avoid it

Developers requiring heavy audio enginesDevelopers needing complex sound synthesis controlProjects requiring CommonJS support

How it works

A quick walkthrough in plain English

How cuelume works

Step 1 of 3

You interact with it

Open cuelume, send a request, or connect it to your stack.

Features

Synthesized live with Web Audio API (no audio files)
Zero runtime dependencies
Curated set of 14 interaction sounds
Declarative binding via data-cuelume-* attributes
Imperative play() API
Global enable/disable via setEnabled()
Pointer-aware interactions (hover, press, release, toggle)
Hover repeat guard (throttled to 150ms)
Single lazy AudioContext shared across sounds
Autoplay-friendly resume handling
Server-side rendering safe (import is a no-op)
Safe fallback for invalid names or blocked Web Audio
Dynamic, idempotent binding that works with later DOM changes
Framework agnostic (works with plain HTML, React, Vue, Astro, etc.)

Advantages

  • Open source (MIT)
  • Active TypeScript ecosystem
  • Self-hosted deployment options

Disadvantages

  • Requires operational ownership for self-hosted setups
  • Community support varies by project maturity

Installation

native

npm install cuelume

FAQ

How do I add sounds to my HTML elements?

You can add data attributes to your markup, such as `data-cuelume-hover` or `data-cuelume-toggle`. After adding the attributes, call the `bind()` function once in your JavaScript to activate the interactions.

Does Cuelume require any audio files?

No. Cuelume uses the Web Audio API to synthesize all fourteen interaction sounds live in the browser, meaning there are zero runtime dependencies and no audio files to host.

Can I use Cuelume in a React or Vue application?

Yes. Cuelume works in any framework that uses HTML. For React, it is recommended to call `bind()` inside a `useEffect` hook after the component mounts.

How do I prevent sounds from playing if a user prefers silence?

You can use the `setEnabled(false)` function to make future sound playback attempts no-ops. Note that Cuelume does not persist this setting to local storage; your application must manage the user's preference.

Is Cuelume compatible with Server-Side Rendering (SSR)?

Yes, Cuelume is SSR-safe. While you can safely import it on the server, sound playback only occurs in the browser where the Web Audio API is available.

What happens if I try to play a sound that doesn't exist?

Cuelume is designed to be safe; invalid sound names or blocked Web Audio contexts will result in a silent no-op rather than throwing an error.

Loading documentation…
View on GitHub

Featured in Videos

YouTube tutorials and walkthroughs for cuelume

Alternatives

Similar projects ranked by category, topics, and text overlap.

Compare
cuelume | MushyBook