COMPONENTS / ATOMS / al-toggle-button← ALL COMPONENTS

Toggle Button

<al-toggle-button><ALToggleButton> REACTbetaOPEN IN FIGMA ↗

Reference generated from the custom elements manifest — 5 properties, 1 slots, 2 events.

PLAYGROUND3 CONTROLS
PREVIEW / al-toggle-button / ALTITUDE
Loading preview
Text Label
FLAGS
CODE — HTML / REACT

Guidance

NOT YET AUTHORED · 20 COMPONENTS COVERED

NO USAGE GUIDANCE HAS BEEN WRITTEN FOR THIS COMPONENT YET. THE API BELOW IS GENERATED FROM THE MANIFEST AND IS COMPLETE; WHAT IS MISSING IS WHEN TO REACH FOR IT AND WHEN NOT TO.

BOTH CHANGEDAltitude Design SystemFIGMA SET · Toggle Button8 PROPERTY DIFFSFROM TRACKED PROJECTION

Code and Figma each changed since the last confirmed sync. Neither side should be overwritten blindly.

DECIDED BY
CONTRACT DIFF
FIGMA SIDE
OBSERVED
LAST CONFIRMED SYNC
2026-08-28
PUBLIC SURFACE
5 ATTR · 1 SLOT · 2 EVENT · 0 PART

The component’s public surface — attributes and their value sets, slots, events, CSS parts and custom properties, from the manifest — compared against the Figma set’s property definitions.

PROPERTYDISAGREEMENTCODE / CANVAS
theme/border/radius/@[token-binding] missing-in-canvas--al-theme-border-radius / —
theme/border/radius/lg[token-binding] missing-in-code— / theme/border/radius/lg
theme/color/background/neutral-weak[token-binding] missing-in-canvas--al-theme-color-background-neutral-weak / —
theme/color/background/transparent-default[token-binding] missing-in-canvas--al-theme-color-background-transparent-default / —
theme/size/control-sm[token-binding] missing-in-canvas--al-theme-size-control-sm / —
theme/space/sm[token-binding] missing-in-canvas--al-theme-space-sm / —
theme/space/xxs[token-binding] missing-in-code— / theme/space/xxs
typography/font-size/12[token-binding] missing-in-canvas--al-font-size-12 / —
CHECKEVIDENCEDETAILRESULT
Default stateAXEtoggle-button--BackgroundPASS
Advanced statesAXE17 further storiesPASS
Screen readerMANUALNo screen-reader pass has been recorded for this component.NOT RECORDED
Keyboard navigationINTERACTION TESTSNo interaction tests and no manual keyboard pass.NOT RECORDED

MEASURED 2026-09-08 · 18 STORIES · AXE WCAG2A + WCAG2AA + WCAG21A + WCAG21AA + WCAG22AA

COLOR CONTRAST0 RULES FAILING

The CI gate disables color-contrast globally (libs/al-web-components/story-fixture/src/main.ts), so its result never reaches a test run. It is enabled for this measurement, and reported here whichever way it comes out.

NO CONTRAST VIOLATIONS ACROSS THIS COMPONENT’S 18 STORIES.

import '@southleft/al-web-components/components/toggle-button';
import { ALToggleButton } from '@southleft/al-react';
PROPTYPEDEFAULT
variant'background'Variant - **default** renders the toggle button without background styles - **background** renders the toggle button with background styles
labelstringAccessible name for an icon-only toggle button. Visible slotted text supplies the name when this property is omitted.
isSelectedbooleanIndicates the selected state of the toggle button.false
isSmallbooleanIf true, a fixed width will be set on the button. - Dynamically set based on the slotted component
hasTogglebooleanHas toggle? - Dynamically enabled when the first slotted element is an ALPopover or ALMenu. - **true** toggles the isSelected state on activation. - **false** selects on activation; Escape or an outside click can deselect.
SLOTDESCRIPTION
(default)The content to display in the toggle button
EVENTDESCRIPTIONTYPE
onToggleButtonSelectFired when the button becomes selected. Detail: `{ item, selected }`.CustomEvent
onToggleButtonDeselectFired when the button becomes deselected. Detail: `{ item, selected }`.CustomEvent
METHODDESCRIPTION
setIsSmall()Set is small 1. If the toggle button content width is less than 48, then set isSmall to true to remove the padding.
toggleSelected()Toggle toggle button selected state 1. Toggle the selected state between true and false 2. Select/deselect the toggle button based on isSelected
handleOnClick()Handle on click 1. If the toggle button is clicked, toggle the selected state
handleOnKeydown()Handle on keydown Enter and Space use the same selection behavior as a click; Escape deselects.
handleOnClickOutside()Handles the click event outside the component: 1. Check if the toggle button is selected 2. Determine if the click occurred inside the selected toggle button 3. Check if the click occurred outside the selected toggle button 4. Close the toggle button if the click occurred outside it

SOURCE — components/toggle-button/toggle-button.ts · Atoms/Form/Toggle Button