Sound Kit

48 interface sounds, synthesized live. No audio files.

Preview

"use client";

import { SoundProvider, successSound, tapSound, useSound } from "@/lib/sounds";

function SaveButton() {
  const tap = useSound(tapSound);
  const success = useSound(successSound);
  return (
    <button
      type="button"
      onPointerDown={() => tap()}
      onClick={() => window.setTimeout(() => success(), 400)}
      className="inline-flex h-9 items-center rounded-full border border-border bg-card px-4 text-sm font-medium text-foreground transition-colors hover:bg-muted"
    >
      Save changes
    </button>
  );
}

export function SoundKitUsage() {
  // One provider sets the volume for every sound, and enabled={false} mutes them.
  return (
    <SoundProvider volume={0.8}>
      <SaveButton />
    </SoundProvider>
  );
}

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/sound-kit

API Reference

SoundProvider

enabled?
boolean

False mutes every beUI sound under the provider.

Defaulttrue
volume?
number

0 to 1, scales every beUI sound.

Default1

useSound(sound, options)

enabled?
boolean

False makes play do nothing, for a component's sound prop.

Defaulttrue
volume?
number

0 to 1 for this sound, on top of the provider volume.

Default1

sound.play(options)

volume?
number

0 to 1, multiplied with the SoundProvider volume.

Default1
pitch?
number

Pitch multiplier; 1 is the designed pitch.

Default1

Updated