Boolean Flags
On/off toggles that conditionally show or hide content.
<vibe-flags-boolean> is a toggle flag. It registers itself with the store and conditionally renders its children based on the flag's current value.
Basic usage
Show content only when the flag is true:
The value="true" attribute means children are shown when the flag is true. The default attribute sets the initial value to true.
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
name | string | '' | Unique flag identifier. Required. |
description | string | '' | Label shown in the toolbar. Falls back to name if omitted. |
value | string | '' | Expected value to show children. If omitted, children are always shown. |
default | boolean | false | Initial value when no stored value exists. Also used by "Reset all to defaults" in the toolbar. |
Patterns
Show when true (most common)
Show when false
Use value="false" to show content when the flag is off:
This is useful for showing mutually exclusive content based on the same flag.
Always show (registration only)
Omit the value attribute to always show children. The flag still registers with the store and appears in the toolbar.
Multiple elements, same flag
Multiple elements can reference the same flag name. They all react to the same toggle:
Default values
The default attribute controls the initial state:
- Without
default— the flag starts asfalse - With
default— the flag starts astrue
If the user has previously toggled the flag, the stored localStorage value takes priority over the default attribute.
The "Reset all to defaults" button in the toolbar resets every flag to its default value.