Skip to main content
Conditionally show or hide parts of a Velt component wireframe. Conditions read the same data as Template Variables. There are two ways to apply one.

1. Using Velt If component

Wrap wireframe components and HTML elements in Velt If. If the condition is false, nothing inside renders. Good for targeting a group of elements at once.

2. Using Velt If attribute

Add the attribute to an existing wireframe component. Good for targeting a single component.

Syntax

A condition is a string evaluated as a JavaScript expression:
Variables go in curly braces and support nested paths ({annotation.comments.length}, {annotation.comments[0].from.userId}). See Template Variables for every available name and which roots allow nested access. Anything outside this list is stripped before evaluation.

Examples

Strict CSP Policy

Some environments enforce a Content Security Policy that disallows unsafe-eval, which blocks the default evaluator. Switch to Velt’s CSP-compliant parser: