Switches

Shows how to use switch controls to show and hide content on the page and properties in the inspector.

Property Value Responsive
switch1{{switch1}}Yes
switch2{{switch2}}No
text{{text}}No
select{{select}}No

If statements

Only non-responsive switch controls can be used in 'if' statements. Responsive controls use tailwind and require a screen size prefix on classes, ie md:font-brand-500

If statements using select

When performing complex logic like string comparisons, use the hooks file to perform this logic and provide simple bool values to the template. This helps to keep templates simple and focused on HTML rather than complex conditional logic.

The selection is an @if(showApple) 🍎 @elseif(showPear) 🍐 @endif