Syntax
- React / Next.js
- Other Frameworks
- class-name: the class to apply, in single quotes.
- template-variable: the variable to evaluate, in curly braces.
- operator:
===,!==,>,>=,<,<=; combine conditions with&&and||. - value: what to compare against, in single quotes for strings.
'is-dark': {darkMode}.
Example
- React / Next.js
- Other Frameworks
Multiple classes and the shorthand form
Separate several classes with commas. For a single class driven by one boolean,velt-class-<name> is shorter.
- React / Next.js
- Other Frameworks
Your classes land on the element alongside Velt’s own. Velt’s runtime styles are high-specificity, so a rule that overrides Velt’s styling still needs
!important: see Override classes.Related
- Many states already have a Velt class you can target directly, no directive needed:
CSS classes. - Hide the element entirely instead of restyling it: Conditional Templates.

