Play Sound On Click

Play Sound On Click

Play Sound On Click

Play Sound On Click

Component

Component

Component

Component

Play Sound On Click

Play Sound On Click

Play Sound On Click

Play Sound On Click

This is a demo file that shows you how to create a component that plays sound when you click the element. We achieve all this in Framer without writing a single line of code

This is a demo file that shows you how to create a component that plays sound when you click the element. We achieve all this in Framer without writing a single line of code

This is a demo file that shows you how to create a component that plays sound when you click the element. We achieve all this in Framer without writing a single line of code

This is a demo file that shows you how to create a component that plays sound when you click the element. We achieve all this in Framer without writing a single line of code

Play Sound On Click
Play Sound On Click
Play Sound On Click
Play Sound On Click

Copy component

Copy component

Copy component

Copy component

Features

The trick with this specific component is it contains a hidden audio component that'll handle sound playback for us.

We've got two variants: "Off" and "On". The only distinction between these two is that in the "Off" variant, the hidden audio is set to "not playing", but it's set to "playing" in the "On" variant.

The next step is to cleverly connect these two variants using interactions. We link the "Off" state to the "On" state with a tap interaction, then we link the "Off" state to the "On" state with an appear interaction. For the appear interaction we set a delay that's just slightly longer than the length of the sound we intend to play.

So, what happens next? We click the button, it transitions to the "On" state, the sound plays, and after the sound has finished, it returns to the "Off" state.

Step 01 outline

Step / 01

Remix the file.

Step 2 outline

Step / 02

See how it's built.

Step 3 outline

Step / 03

Recreate it for practice.

Free Framer Course

Learn how to create stunning websites with ease by learning the fundamentals of Framer.

Free
Framer Course

Learn how to create stunning websites with ease by learning the fundamentals of Framer.

Free Framer Course

Learn how to create stunning websites with ease by learning the fundamentals of Framer.