Menu
Libraries |
Category

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:

    1. sound action: Directly attach to elements with sound source and event triggers
    2. useSound: Create reusable sound actions for multiple elements
    3. Sound 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

Comments