How to change variant on scroll?

Hi! Is there a feature to change variant on scroll? I want my top menu to change style when scrolled

Hello @electronic_falcon! Unfortunately, we don’t have this native in the studio but you can create this using code-components https://docs.plasmic.app/learn/code-components/.

For example, you can design a variant for the top menu when it’s scrolled and change the style in your code component.

Thank you for response! Can I activate variant from isAttachment: true code component? When I am trying to set children.props.myVariant = true it shows an error saying that props is not editable.

You can’t change the prop directly, but you can clone the react element and set the prop.
React.cloneElement(children, { myVariant: true })

Thank you, it works now!