You can create a hover animation in Figma by defining different states of an element as component variants and linking them with a "While Hovering" interaction in the Prototype tab.
Creating interactive elements like buttons, cards, or navigation links that react when a user hovers over them significantly enhances the user experience in your designs. Figma's component and prototyping features make this process straightforward.
Here's a step-by-step guide based on the standard process:
Steps to Create a Figma Hover Effect
Building a hover animation involves creating the different visual states of your element and then defining how they transition when a user hovers.
-
1. Create A Frame And Design The Default State Of Your UI Element.
Start by designing the initial appearance of your UI element (like a button) within a Frame. Once your design is complete, select the element and create a **Component** from it (right-click > Create Component or use the icon in the top bar). Components are reusable UI elements.
-
2. Create Component Variants.
With the Component selected, click the **"+"** icon in the "Variants" section of the right-hand panel. This creates a copy of your component, linked to the original as a **Variant**. Variants allow you to define different states or versions of the same component (e.g., default, hover, pressed, disabled).
-
3. Add A Hover State.
Select the newly created Variant. This variant will represent the *hover* state of your element. Modify its appearance to how you want it to look when the user hovers over it. This could involve changing the background color, text color, adding a shadow, scaling the element, or any other visual change.
Rename the default variant property (e.g., "State: Default") and the hover variant property (e.g., "State: Hover") in the right-hand panel for clarity.
-
4. Add Animation To The Figma Hover Effect.
Now, switch to the **Prototype** tab in the right-hand panel. Select the *default* state variant. You'll see a small circle icon on the element's edge. Click and drag this circle to the *hover* state variant. This creates an **Interaction** between the two states.
In the Interaction details panel that appears:
- For the **Trigger**, select **"While Hovering"**. This tells Figma to initiate the interaction when the mouse cursor is over the element.
- For the **Action**, keep "Change to" selected and ensure it points to your hover state variant.
- For the **Animation**, select **"Smart Animate"**. Smart Animate is Figma's powerful feature that interpolates between differing layers and properties, creating smooth transitions for things like position, size, color, and opacity.
- Adjust the animation **Easing** and **Duration** to control how the transition looks and feels. Common easing options include "Ease Out" or "Ease In-Out" for smoother effects.
You might also want to add a return interaction from the hover state back to the default state. While Smart Animate often handles the return automatically when the hover ends, explicitly adding an interaction from the hover state back to the default state with a "While Hovering" trigger pointing back ensures the element returns to its original state when the mouse leaves.
-
5. Preview And Adjust Your Hover Effect.
To see your hover animation in action, place an instance of your component on a page or in a prototype flow. Click the **Present** button (the play icon) in the top right corner of Figma. When you hover over the component instance in the prototype view, you should see your designed animation.
Go back to the Prototype tab to fine-tune the interaction settings (trigger, animation type, duration, easing) until the hover effect is exactly how you want it.
By following these steps, you effectively create a component set with defined states and prototype interactions, enabling interactive hover effects in your Figma designs.