Docs / Components

SenseToggleButtonComponent

Two-state push button for boolean toggles with localized on/off labels and forms CVA support from @artificialsenselabs/ui.

Live demo: run nx serve showcase and open /components/toggle-button (port 4202).

Overview

Category: Form controls. Selector: sense-toggle-button. Import: import { SenseToggleButtonComponent } from '@artificialsenselabs/ui';

Accessibility

  • Native <button> exposes aria-pressed reflecting the checked state.
  • Visible label defaults from i18n; override with onLabel / offLabel.
  • Space and Enter activate the toggle; disabled state blocks interaction.
  • Use ariaLabel when the visible label alone is not descriptive enough.