Skip to content

Visibility Control

You can dynamically show or hide content based on the respondent's Accessibility Mode (Easy Read, Sign Language, etc.) or the active Color Theme (Light or Dark mode).

There are three ways to apply these visibility rules, depending on whether you prefer native Markdown syntax or raw HTML.

Available Visibility Classes

Use these class names in any of the methods described below.

CategoryClass NameDescription
Themedark-onlyVisible only in Dark Mode.
Themelight-onlyVisible only in Light Mode.
A11yshow-when-easyreadVisible only in Easy Read mode.
A11yhide-when-easyreadHidden in Easy Read mode.
A11yshow-when-signlanguageVisible only in Sign Language mode.
A11yhide-when-signlanguageHidden in Sign Language mode.
A11yshow-when-readaloudVisible only in Read Aloud mode.
A11yhide-when-readaloudHidden in Read Aloud mode.

Best for: Multi-line blocks of content and logos.

The triple-colon syntax (:::) is the cleanest way to wrap content. It maintains the "look and feel" of Markdown and doesn't require complex HTML nesting.

markdown
::: dark-only
### Dark Mode Special
This section is rendered only when **Dark Mode** is active.
:::

Why use Directives?

  • Readability: Content remains easy to read in the editor.
  • Markdown Support: You can use standard Markdown (like bold, lists, and headings) inside the block without worrying about HTML nesting rules.

Method 2: Attribute Syntax

Best for: Single elements like images or links.

You can apply a visibility class directly to an image by adding {.class-name} at the end of the Markdown line.

markdown
![Dark Logo](logo-dark.png){.dark-only}
![Light Logo](logo-light.png){.light-only}

Method 3: HTML Containers

Best for: Power users needing complex layouts.

For advanced scenarios, such as combining visibility with Convenience Classes (like Flexbox), you can use standard <div> tags.

html
<div class="layout flex dark-only">
  This container is a flex-child AND only visible in dark mode.
</div>

WARNING

When using HTML tags, you must leave an empty line before any Markdown content inside the tag, and ensure the Markdown is not indented.


Comparison: Directives vs. HTML

FeatureBlock Directives (:::)HTML Containers (<div>)
Syntax::: class-name<div class="class-name">
ComplexitySimple, native feelRequires closing tags and correct nesting
ReadabilityHighModerate (clutters the editor)
Use CaseMost content blocksMulti-class layouts (e.g., Flexbox + Visibility)

TIP

Prefer conditional visibility for the entire field when possible. Conditional visibility at the field level is more efficient than hiding specific sections of text within a field.