Charcoal UI

UI Sounds

Forty-five interface sounds (clicks, toggles, success, error, notifications, whooshes, coins and more) synthesised live with the Web Audio API. No audio files, a playSound function, a useSound hook and a shared on/off switch.

Examples

UI Sounds

API reference

PropTypeDefaultDescription
playSound(name, options?)(name: SoundName, { volume?, pitch?, force? }) => void—Plays once. force ignores the off switch.
useSound(name, options?)() => void—A stable play function for event handlers.
useSoundsEnabled()[on: boolean, set: (on: boolean) => void]—
setSoundsEnabled(on)(on: boolean) => void—Remembered in localStorage.
soundsRecord<SoundName, Voice[]>—The definitions; add your own.

About UI Sounds

UI Sounds gives your interface 45 sounds, from clicks, toggles and success chimes to notifications, whooshes and coins, all synthesised live with the Web Audio API. There are no audio files to host or licence.

UI Sounds is an UI sound effect for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.

When to use UI Sounds

  • Buttons, toggles and form feedback.
  • Chat and notification apps.
  • Games and reward moments.
  • Accessible audio cues alongside visuals.

How it works

Each sound is a list of oscillator and filtered noise voices with fast attacks and exponential decays. One shared audio context starts on the first gesture, and a remembered on/off preference is honoured everywhere.

Sound is always secondary: it is muted until you allow it, respects a global mute, and never carries information that is not also shown on screen. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.

Customizing UI Sounds

Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.

The Customize panel next to the preview lets you change volume, pitch live, and the Code tab updates to match, so the snippet you copy already carries your values.

  • playSound(name, options?): Plays once. force ignores the off switch.
  • useSound(name, options?) (() => void): A stable play function for event handlers.
  • useSoundsEnabled().
  • setSoundsEnabled(on) ((on: boolean) => void): Remembered in localStorage.
  • sounds (Record<SoundName, Voice[]>): The definitions; add your own.

Goes well with UI Sounds

These sounds pieces share its tokens and motion language, so they sit together on one page without clashing.

  • Sound Toggle: A free React sound on/off toggle with animated speaker waves

Install UI Sounds

npx shadcn@latest add @charcoal/ui-sounds

UI Sounds is part of Charcoal UI Pro. One seat unlocks all 393 Pro components, 112 landing-page sections and 100 full templates, for every personal and client project, with updates included. Add the @charcoal registry once with your access token, then the command above copies ui-sounds.tsx into components/ui and installs clsx, tailwind-merge.

You own the file you install: no runtime package, no lock-in, nothing to keep in sync. Change it however your product needs.

See Charcoal UI Pro pricing · Pro setup

Frequently asked questions

How do I install UI Sounds?
UI Sounds is part of Charcoal UI Pro. Add the @charcoal registry to components.json with your access token, then run npx shadcn@latest add @charcoal/ui-sounds. It copies ui-sounds.tsx into components/ui and installs motion, clsx, tailwind-merge.
Is UI Sounds free for commercial use?
UI Sounds needs a Charcoal UI Pro seat, monthly or a one-time lifetime price. A seat covers unlimited personal and commercial projects, including client work, and every future Pro component.
Does UI Sounds work with Next.js?
Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
Can an AI coding agent install UI Sounds?
Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns UI Sounds's props and get_install_command returns the exact command.

UI Sounds as Markdown · llms.txt