Skip to main content
Solved

Hover effect for components with different data


Chris_de_Ronde

Hi all,

So I made this component which I animated using a hover effect. It works perfectly fine!

However… When I change the text/icon inside that component, the hover effect will trigger the initial hover version without the altered text.

My question is: Is there a way to apply the hover effect on variants of that card without recreating the component for all other variants?

Best answer by tank666

Rename the layers to match each other in both Variants, or apply the appropriate component props to the desired layers.

For example:

  1. Variant 1 and Variant 2 (renamed nested layers)
    – Icon
    – Title
    – Description

  2. Variant 1 and Variant 2 (applied component props)
    – Icon (Icon instance swap prop)
    – Title (Title text prop)
    – Description (Description text prop)

View original
This topic has been closed for comments

3 replies

tank666
  • 4859 replies
  • Answer
  • August 3, 2023

Rename the layers to match each other in both Variants, or apply the appropriate component props to the desired layers.

For example:

  1. Variant 1 and Variant 2 (renamed nested layers)
    – Icon
    – Title
    – Description

  2. Variant 1 and Variant 2 (applied component props)
    – Icon (Icon instance swap prop)
    – Title (Title text prop)
    – Description (Description text prop)


Chris_de_Ronde

I need to name my layers correctly… That did the trick! Thanks! 🙂


  • 0 replies
  • August 6, 2023

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings