---
title: "Tap Sound"
description: "A fingertip on glass: a crisp contact, a small glass ring and a soft knock, for taps and plain clicks."
category: "Sounds"
publishedAt: "2026-11-24"
updatedAt: "2026-11-25"
documentation: "https://beui.dev/sounds/tap-sound"
markdown: "https://beui.dev/sounds/tap-sound.md"
license: "MIT"
---

# Tap Sound

> A fingertip on glass: a crisp contact, a small glass ring and a soft knock, for taps and plain clicks.

## Install

```bash
npx shadcn@latest add @beui/tap-sound
```

## Dependencies

- `clsx`
- `motion`
- `react`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { useSound } from "@/lib/sound";
import { tapSound } from "@/lib/sounds/tap";

export function TapSoundUsage() {
  const play = useSound(tapSound);
  return (
    <button type="button" onClick={() => play()} 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">
      Tap
    </button>
  );
}
```

## API Reference

### sound.play(options)

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `volume` | `number` | `1` | No | 0 to 1, multiplied with the SoundProvider volume. |
| `pitch` | `number` | `1` | No | Pitch multiplier; 1 is the designed pitch. |

### useSound(sound, options)

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `enabled` | `boolean` | `true` | No | False makes play do nothing, for a component's sound prop. |
| `volume` | `number` | `1` | No | 0 to 1 for this sound, on top of the provider volume. |

## About Tap Sound

Tap Sound is an interface sound for React and the web, synthesized live with Web Audio. It is a fingertip on glass: a crisp contact click, a small glass ring and a soft knock under it, with a little random pitch so repeated taps don't sound stamped. Import tapSound and call play(), or use the useSound hook, which follows SoundProvider for app-wide volume and mute.

### When to use it

- Plain clicks on cards, list rows and icon buttons.
- Chips, tags and filters that react to a tap.
- Any control that needs a quiet confirmation it was touched.

### Accessibility

A sound plays only in answer to the user's own input, never on its own, and it never carries meaning alone: pair it with the visible change it marks. Wrap the app in SoundProvider to give people one mute switch and a volume, and remember their choice.

### FAQ

**Does it load an audio file?**

No. tapSound is a short recipe that Web Audio plays the moment it is called: a click of filtered noise for the contact, a body that rings at the partials of a real material and settles in pitch, and a touch of a small room generated in code. Nothing is downloaded and it works offline.

**How do I play it outside React?**

Call tapSound.play() from any event handler. In React, useSound(tapSound) gives a stable play function that respects SoundProvider and a component's sound prop.

**Why is there no sound on page load?**

Browsers only start audio after a user gesture. The first press or key unlocks it, which also keeps sounds tied to what the user did.

## Source

- Registry detail: https://beui.dev/r/tap-sound
- Raw source: https://beui.dev/r/tap-sound/raw
- GitHub: https://github.com/starc007/ui-components
