Skip to main content
  • 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.
There are two ways to use Conditional Templates:

1. Using Velt If component

  • Wrap wireframe components and html elements in Velt If component.
  • If the condition is not met, the component will not be rendered.
  • Good for targeting groups of components at once.

2. Using Velt If attribute

  • Add Velt If attribute to existing wireframe components.
  • If the condition is not met, the component will not be rendered.
  • Good for targeting a single component.

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:
Operators allowed in a condition: Anything outside this whitelist is stripped before evaluation (safe by design).

Strict CSP Policy

Some environments enforce strict Content Security Policies (CSP) that disallow unsafe-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.

Examples

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

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.
If a short alias resolves to 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.)
If a deep path returns 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 renders undefined/blank, check, in order:
  1. Spelling: exact name from Template Variables (case-sensitive).
  2. Nested access: is the root in the nested-access list above? If not, you can only read its root.
  3. 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.)
  4. Mapped vs flat: for flat-config features use {componentConfig.<name>}.
The full variable list (and which roots allow nested access) is in Template Variables.