Can anyone help me with Custom states to show/hide?

Here’s a brief description with an example. There’s a custom state called “mode” on the page element.