Skip to main content

FAQ Accordion component

Learn how to create a simple accordion component using 2 parametric animations

I
Written by Inbal Shemesh
Updated over 3 months ago

To create this accordion component we'll create 2 parametric interactions:

1. Accordion opens/closes

To animate the accordion body expanding and collapsing:

Step-by-step

  • Select the parent frame of one of your accordion cards (Accordion-Card)

  • Create a new parametric animation → choose On click as the action

Settings → Properties

  • Turn Yoyo ON

  • Set Repeat to Once

Trigger & Target

  • Trigger: Keep Accordion-Card selected (component parent frame)
    → Turn ON "By name"

  • Target: Select text-frame-main (outermost frame of your body text)
    → Turn ON "By name" and "Use replicator"

Animation properties

  • Choose: Height, Opacity

  • Turn ON "Start from"

  • Set:
    Height = 0
    Opacity = 0

  • Duration: 0.5s


2. Arrow rotates when accordion opens

To animate the arrow icon rotation when the accordion is toggled:

Step-by-step

  • Select the same parent frame (Accordion-Card)

  • Create a new parametric animation → choose On click

Settings → Properties

  • Turn Yoyo ON

  • Set Repeat to Once

Trigger & Target

  • Trigger: Accordion-Card (component parent frame)
    → Turn ON "By name"

  • Target: Arrow2 (parent frame of the arrow icon)
    → Turn ON "By name" and "Use replicator"

Animation properties

  • Choose: Rotate

  • Use "Change to"

  • Set: rotation = -90°

  • Set Duration: 0.3s

Did this answer your question?