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

What is Framer? Join the Community
Return to index
Joshua Pekera
Posted Jun 11 - Read on Facebook

Can we change the color of a text layer with a stateSwitch that was created in the design view of Framer? I want to change a text label's color when clicked. I know it can be done easily if it was imported from Sketch, but I'm trying it out in the new design mode.


Joshua Pekera

Jay Stakelon thoughts?

Joshua Pekera

Here is an example Trying to change the tab label color when the tab icon in active.

Cédric Magnin

That's strange, the textLayer from design does not behave like a textLayer in code.

Derek Nguyen

It seems that text created in design tab is just a layer with image instead of a real TextLayer instance. For that reason, the 'color' property won't do anything. In order to achieve what you want, there's a hack using CSS filter:

- in Design tab, change the color into the 'active' state instead of default (for example, if your text normally black, and then change into red, then at the deisgn tab make the text red.)

- in your code, create a state with 'brightness' property set to 0. This will make the text goes black

- now stateswitch should change your text color. if you want the default state to be a different color, maybe play around with 'hueRotate'

Here's an example:

I think if you need more control, for now it's better to create the TextLayer in code instead +__+

Lukas Guschlbauer

Koen, Jonas! Do you guys know about this? Seems like it's not possible to change any properties of a textLayer created in "Design"-Mode!

Read the entire post on Facebook