Components / Onboarding and feedback / Companion toggle

F3 · Onboarding and feedback

Companion toggle

Shows or hides the companion slot. The slot stays empty either way.

When to use

  • People can turn the companion off.
  • The slot is the only companion surface.

When not to use

  • The companion is required for the task.
  • Hide would remove a form field.

Usage

<label class="c-switch"><input type="checkbox" data-show-companion checked> Show companion</label>
<div class="slot">Bud companion, pending yravgBud</div>

Variants

The preview shows the form used in the gallery.

Props

NameTypeDefaultDescription
data-show-companioncheckboxcheckedWhen unchecked, the slot is hidden.
slotelementvisibleSame pending label as the companion card.

Keyboard

KeyAction
SpaceToggles the checkbox.
TabMoves to the checkbox.

Accessibility

Motion

Pattern origin

Pattern type: a show or hide control for the companion slot.

Related

Companion card