(this page was created automatically. In case of formatting issues, please visit the official Wiki Page)

Content Switch

Overview

Example Content Switch

Specs

Tokens

Token Description
displayName Label shown in structure panel.
elements Defines elements and their configs.
elements.id Unique ID for an element.
elements.disabled Disables element interaction.
elements.ON_CONTENT_SWITCH_CLICK (Events) Fires on content-switch select.
activeButtonIndicator Sets active switch by ID.
displayConditions Show/hide rules for visibility.
showTooltip Toggle tooltip on hover. NYI
tooltipText Tooltip text. NYI
tooltipPlacement Tooltip position (top/bottom/left/right). NYI
tooltipDelay Delay before tooltip appears (ms). NYI
type Visual style: DEFAULT/GHOST.
events Container for component events.
ON_INIT (Events) Fires on component initialization.
ON_DESTROY (Events) Fires when component is removed.
visibilityPolicySetId Visibility via policy set.
tests.id Component test identifier.
dataTestId Testing hook selector.
enableAsHotspot Enable guided-tour hotspot.
guidedTourHotSpotTitle Hotspot title (i18n).
guidedTourHotSpotDescription Hotspot description (i18n).

Structure

(Configured in General Properties)

(Configured in Visual Properties)

(Configured in Visibility)

Tooltip

(not jet implemented)

Example tooltip

Styling

(Configured in Visual Properties)

Actions & Variants

(Configured in Events)

Authorization

(Configured in Authorization)

Tests

(Configured in Testing Hooks)

Links

Guidelines

Usage

Sizing & Layout

States & Feedback

Visibility & Authorization

Content & Localization

Dos & Don’ts

Do Don’t Article setting(s)
Wire logic to elements.ON_CONTENT_SWITCH_CLICK to update the view and activeButtonIndicator. Depend on implicit navigation without handling the click event. elements.ON_CONTENT_SWITCH_CLICK, activeButtonIndicator
Disable unavailable choices with elements.disabled: true. Let users select options that will error or show empty content. elements.disabled
Use type="DEFAULT" when the active state needs a visible highlight. Use type="GHOST" where users must always see what’s active. type
Hide the component for users without access. Show it to all users and rely on downstream errors. visibilityPolicySetId
Render the switch only when relevant using displayConditions. Show it briefly and then hide it after initialization (visual flicker). displayConditions
Keep the order of options stable by managing elements[] deterministically. Add/remove/reorder options unpredictably mid-session. elements
Provide stable automation handles. Change test IDs between builds. dataTestId, tests.id
Guide users with localized hotspot text when onboarding. Put critical instructions into tooltips (they are NYI). enableAsHotspot, guidedTourHotSpotTitle, guidedTourHotSpotDescription
Clean up on teardown. Leave timers/listeners active after removal. ON_DESTROY

Accessibility