- Conditional Templates let you conditionally show or hide parts of the Velt Component Wireframes.
- You can add conditions based on the same data models available in Template Variables.
1. Using Velt If component
- Wrap wireframe components and html elements in
Velt Ifcomponent. - If the condition is not met, the component will not be rendered.
- Good for targeting groups of components at once.
- React / Next.js
- Other Frameworks
2. Using Velt If attribute
- Add
Velt Ifattribute to existing wireframe components. - If the condition is not met, the component will not be rendered.
- Good for targeting a single component.
- React / Next.js
- Other Frameworks
Syntax
The condition is specified as a string that will be evaluated as a JavaScript expression. Syntax:{<variable>} <operator> <value>
Example: {annotation.status.id} === 'OPEN'
Template variables are enclosed in curly braces and support nested paths:
Anything outside this whitelist is stripped before evaluation (safe by design).
Strict CSP Policy
Some environments enforce strict Content Security Policies (CSP) that disallowunsafe-eval. In such cases, the default method could be blocked and the conditions may not be evaluated.
Here is how you can use an alternative approach to evaluate Velt If conditions. This method uses a safer, CSP-compliant parser to evaluate your Velt If conditions.
- React / Next.js
- Other Frameworks
Examples
- React / Next.js
- Other Frameworks
Related Directives
Two sibling directives use the same{token} syntax as Velt If:
velt-data: print a live value as text
Documented with the full data catalog in Template Variables.
velt-class: toggle CSS classes conditionally
- React / Next.js
- Other Frameworks
Mapped vs. flat-config features (which name form to use)
Two access conventions exist, as a rule of thumb:- Mapped: use short aliases like
{annotation.from.name}: Comment Dialog, Comments Sidebar, Comment Bubble, Inline Comments Section, Multi-Thread Comment Dialog, Text Comment, Notifications Panel, Notifications Tool, Activity Log. - Flat-config: use the explicit
{componentConfig.<name>}form: Cursor, Presence, Huddle, Recording, Transcription, View Analytics, Area, Arrow, Tag, Reactions, Selection, Rewriter, Comments Tool, Sidebar Button, Autocomplete.
undefined in a flat-config feature, fall back to {componentConfig.<name>}. Mapped features accept the explicit form too; it’s just not required.
Variables that support nested access
Only these root names allow{root.nested.field}; any other variable resolves to its root only. (Per-component variable lists with examples: Template Variables.)
undefined, first check the root is on this list.
Frequently used variables (Comment Dialog / Sidebar)
A small starter set: see the per-feature page for the full list and types:Debugging a token that shows nothing
If a token rendersundefined/blank, check, in order:
- Spelling: exact name from
Template Variables(case-sensitive). - Nested access: is the root in the nested-access list above? If not, you can only read its root.
- Context: are you inside a slot that actually receives that variable? (e.g.
{comment}/{commentIndex}exist only inside thread-card descendants;{notification}only in the notifications panel.) - Mapped vs flat: for flat-config features use
{componentConfig.<name>}.
The full variable list (and which roots allow nested access) is in Template Variables.

