Add Sound Effects to Your React Apps Effortlessly
react-sounds provides a library of ready-to-play sound effects with a simple API, lazy loading, and offline support.MIT License
npm install react-sounds howlerKey Features
ð Extensive Library
Access curated sounds organized by category (UI, notification, game, etc.).
ðŠķ Lightweight
Only JS wrappers included in the package. Audio files are hosted on a CDN to keep your bundle size small.
ðïļ Lazy Loading
Sounds are fetched efficiently only when they are needed, improving initial load performance.
ðĶ Offline Support
Easily download and bundle sounds for self-hosting using the included CLI tool.
ðŊ Simple API
Integrate sounds effortlessly with easy-to-use hooks (like useSound) and components (like SoundButton).
âïļ Configurable
Customize CDN URLs, preload sounds, enable/disable sounds globally, and control playback options.
Interactive Sound Demo
Basic Usage
Click the buttons to hear different sound effects.
import { useSound } from 'react-sounds';
function Button() {
const { play } = useSound('ui/button_soft');
return <button onClick={play}>Click Me</button>;
}Advanced Controls
Try adjusting these parameters before playing the sound.
Sound Effects Categories
Notification Sounds
Ideal for alerts, confirmations, and system events
Game Sounds
Great for achievements, collectibles, and game events
UI Sounds
Perfect for buttons, toggles, and interface interactions
Need more sounds?
openfoley is an open library of sound effects and sound packs made for react-sounds. Every sound is free to use under CC0, and you can generate new ones with AI.
Browse openfoleynpx react-sounds-cli add https://openfoley.com/c/ui-soundsReady to add sounds?
Check out the documentation or install the library now.