svelte-sound
Purpose: A Svelte action library for playing interaction sounds on DOM events using Howler.js core
Key Features:
- Lightweight and performant
- Uses dynamic imports for Howler to support partial hydration
- Scalable for complex interactions (like games)
- Truly reactive by default
Svelte-Specific Support: Designed exclusively for Svelte applications
Three Usage Methods:
sound
action: Directly attach to elements with sound source and event triggersuseSound
: Create reusable sound actions for multiple elementsSound
class: Programmatic control without DOM events
Event Handling:
- Supports play/stop events configuration
- Programmatic control via element methods (
play()
/stop()
)
Example Use Case: Adding click sounds to buttons with simple Svelte actions
License: MIT fa-solid fa-up-right-from-square
Maintainer: Rajaniraiyn fa-solid fa-up-right-from-square
sveltesvelte-actionsveltekitvitehacktoberfest
Featured Stories
No featured articles here. Navigate to an article, then pick the Feature on menu button