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

What is Framer? Join the Community
Return to index
Jorge Alvarez
Posted Nov 08 - Read on Facebook

Hi all, quick question on handling classes. I've built this simple tabbar navigation: https://framer.cloud/hHprn.

Each of the three items is a class with a title, and a little indicator. When clicking each of them, they become "active" and style changes. I'm trying to have the other two items to reset to their default states, but I'm struggling to do it. It doesn't work neither inside of the class definition, or outside as a separate function (I can't access layers inside of the class)

Thanks for the help! 🙏

1 Comments

Alexis Morin

Hey bud,
Here pseudocode as to how I handle similar situations.
-keep references of your tabs (in an array, in the TabBarNav class)
-when switching:
foreach of the tabs
if (activeTab)
make the tab active
else
make the tab inactive

Read the entire post on Facebook