This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
John Marstall
Posted Nov 07 - Read on Facebook

Framer has deprecated the layer.states.add syntax in favor of layer.states = . In light of this is it possible to add states to a layer which already has some? For example

layerA.states =
show:
opacity: 1

and then later

layerA.states =
hide:
opacity: 0

So far this kind of thing seems to overwrite rather than append layer states. Is there another way?

5 Comments

Jordan Robert Dobson

yeah. it's listed in some documentation somewhere i have but not on my phone. i'll post it to you in an hour or two. but you're right it does replace.

Dave Kover

You can just declare new states by having

layerA.states.show =
opacity: 1

layerA.states.hide =
opacity: 0

Maxim Melnikov

layerA.states.hide =
opacity: 0

Jordan Robert Dobson

John - this seems to be the most helpful: https://github.com/koenbok/Framer/wiki/New-Animation-API#states

Take a look at where they are they are using _.extend to include the previous states:

layer.states = _.extend layer.states,...

John Marstall

thanks guys!

Read the entire post on Facebook