The Spatial Audio Button is a high-performance interactive component designed for designers who want to add an extra layer of sensory depth to their Framer projects. Unlike standard buttons that play a static audio file, this component utilizes a Stereo Panner and Biquad Filter to modulate audio in real-time.
When a user clicks the button, the component calculates the relative position of the cursor:
Horizontal Position: Maps to stereo panning (Left/Right).
Vertical Position: Controls a Low-pass filter, making clicks near the bottom sound "muffled" and clicks near the top sound "crisp."
Proximity: Subtly adjusts volume based on the distance from the center.
Dynamic Spatial FX: Real-time audio manipulation based on click coordinates.
Full Customization: Control typography, background colors, border radius, and padding directly in the Framer canvas.
Custom Audio Support: Upload your own MP3, WAV, or OGG files to match your brand's sonic identity.
Motion Integrated: Built with Framer Motion for smooth scale-down "tap" animations.
Accessibility Minded: Includes Aria-label support and full keyboard navigation (Enter/Space triggers).
1. High-End Portfolios & Creative Studios
For designers or agencies looking to make a lasting first impression, the Spatial Audio Button adds a layer of "digital polish." Use it for the primary "View Project" or "Contact" buttons. The subtle 3D sound feedback signals to the visitor that every detail of the site—down to the audio physics—has been meticulously crafted.
2. Immersive Gaming & Meta-Web Experiences
If you are building a site for a video game, a VR project, or a "metaverse" landing page, standard UI feels flat. By using this button for "Enter Experience" or "Start Game," you prepare the user for a multi-sensory environment. The spatial panning mimics the way sound works in a 3D engine, bridging the gap between a 2D website and a 3D world.
3. Experimental E-Commerce
Break the "Add to Cart" monotony. For luxury brands or tech-heavy products (like headphones or synthesizers), use the spatial button for "Buy Now" or "Pre-Order." The tactile, "clickable" sound provides a satisfying psychological "thud" or "click" that makes the digital purchase feel more physical and rewarding.
4. Interactive Soundboards & Musical Kits
Because the button maps vertical and horizontal position to frequency and panning, you can stack several of these with different audio samples (like a drum kit or synth notes). This allows users to "play" the UI, turning a simple navigation menu into a miniature musical instrument that responds to exactly where they touch the screen.
5. Accessibility-Focused Feedback
While primarily a stylistic choice, the spatial audio provides redundant feedback. For users with low vision who rely on audio cues, the change in pitch and panning provides spatial orientation, confirming not just that they clicked, but where on the element the interaction occurred.