Play Sound On Click

Copy component

Copy component

Play Sound On Click

Copy component

Nandi Muzsik

How can I improve Framer Uni?

Let me know if there’s a missing feature or something that could be improved.

Share feedback

How to Make $10K+ with Framer in 60 days

How to Make $10K+ with Framer in 60 days

Component

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

image of Nandi Muzsik

Created by

Play Sound On Click

About the resource

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.

About the resource

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.

About the resource

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.

Learn how can one go from 0 to $11.5k with Framer in 60 days.

From no followers, no portfolio, no reputation, to making thousands with a profitable Framer business.

Nandi portrait's background

Learn how can one go from 0 to $11.5k with Framer in 60 days.

From no followers, no portfolio, no reputation, to making thousands with a profitable Framer business.

Nandi portrait's background

Learn how can one go from 0 to $11.5k with Framer in 60 days.

From no followers, no portfolio, no reputation, to making thousands with a profitable Framer business.

Nandi portrait's background

More resources

More resources

  • Stair-step text hover effect on the word 'STAND

    Text Lift on Hover in Framer

    Component

    Stair-step text hover effect on the word 'STAND

    Text Lift on Hover in Framer

    Component

  • Web Haptics for Framer component with feedback examples

    Mobile Haptics in Framer

    Component

    Web Haptics for Framer component with feedback examples

    Mobile Haptics in Framer

    Component