This matches the Gutenberg Toggle Content pattern (primary / secondary inner content and a pill, switch, or button control).

Overview

Note

Provided by Aegis Dash. Since Aegis Dash 1.1.0 this block is registered by the plugin. It appears in the inserter once one of its settings is on at Aegis → Blocks → Toggle; there is no separate switch for the block itself. A site that already used the block through the Aegis theme has those settings turned on the first time Aegis Dash 1.1.0 loads. The theme only registers its own copy while Aegis Dash is not providing the block. Extras marked Pro need Aegis Pro.

BlockNameRole
Toggleaegis/toggleSwitcher control + two views
Toggle Contentaegis/toggle-contentOne view (slot a or b)

Toggle Content only inserts inside a Toggle block. The inserter template creates both views.

Toggle attributes

AttributeTypeDefaultDescription
switchStylestringswitchpill, switch, or buttons (limited to enabled extras)
alignmentstringcenterleft, center, or right
primaryLabelstringemptyLabel for view a (translated “First” when empty)
secondaryLabelstringemptyLabel for view b (translated “Second” when empty)
initialContentstringaWhich view is shown first
animationDurationnumber300Transition duration in ms (pill/switch motion and Pro animations)
allowNestedbooleanfalseAllow a Toggle inside Toggle Content (Pro extra toggle_nested)
instanceIdstringemptyStable id for persist/ARIA, set from the editor clientId

Saved accordion-era Toggle blocks (heading + one content pane) migrate to a switcher: the heading becomes the primary label, existing content becomes view a, and an empty view b is added. Migration only runs when inner blocks are not already Toggle Content.

Usage

Each Toggle Content block is one switchable panel.

  1. Enable at least one extra at Aegis → Blocks → Toggle (Pill, Switch, or Buttons is enough).
  2. Insert the Toggle block.
  3. Edit the two labels (with Custom Labels on) and add blocks inside each Toggle Content view.
  4. Click a label to preview the other view in the editor. Selecting a block inside a view also switches the preview to that view.
  5. Optionally set alignment and which view is shown first.

Appearance (light and dark)

Pill, switch, and button styles use Aegis mode tokens so labels stay readable in light and dark:

Toggle in light and dark mode.

Do not use WordPress base / contrast presets — this theme does not define them.

Aegis → Blocks → Toggle

There is no parent Toggle toggle. Enabling any extra implies the block (same pattern as Related Posts and Slider). Without Aegis Dash (the theme’s own copy), all free extras behave as on. The aegis/toggle-content child uses the same parent key.

ExtraInspector / renderOff fallback
toggle_pillPill switcher styleStyle unavailable; another enabled style (or Switch) is used
toggle_switchSwitch (track + thumb) styleStyle unavailable
toggle_buttonsSeparate button styleStyle unavailable
toggle_positionAlignment (left / center / right)center
toggle_labelsEditable primary and secondary labelsLabels stay “First” / “Second”
toggle_animationsAnimation duration (Pro extra, shown in the free inspector)300 ms

Inspector extras are passed as window.aegisToggleFeatures on the block editor script.

Pro sub-features

Aegis → Blocks → Toggle Pro extras (when Aegis Pro is licensed): URL sync (?param=a / b), state persistence, animations (fade, slide, flip, scale), nested toggles inside Toggle Content, and conditional visibility of other elements. Duration stays on the theme inspector so it is not duplicated in the Pro panel. The inspector reads window.aegisToggleEditor.features. Nested Toggle inserts require the extra and Allow Nested Toggles on that block.

On click, the theme script updates the control and dispatches aegis:toggle:changed without swapping panel .is-active when a Pro animation class is present. Pro toggle-view.js then runs animateTransition(). URL init, persist restore, and prefers-reduced-motion: reduce swap instantly. A URL param wins over stored state. Nested switcher events are ignored. Persist keys use data-toggle-id from the HTML anchor, else saved instanceId, else a hash of the block source. Back/forward with URL sync also updates conditional visibility.

FAQ schema is not part of this block. Accordion List has accordion_faq_schema.

See Aegis Dash Block Variations and Pro Block Extensions.

Developer notes

Next Steps