A two-state button with aria-pressed, alone, in a ToggleGroup or in a Toolbar (the APG toggle button), in each framework.
A button the user presses on and off (WAI-ARIA APG button pattern,
its toggle button): a native <button> with aria-pressed, or your own element (render) with
the keys a native button has. Inside a ToggleGroup it is one of the
group's values; inside a Toolbar it is one of the toolbar's items. Toggle is
one component, not a namespace.
State: pressed (controlled) or defaultPressed; every press reports the new state with
reason none. The accessible name never changes with the state: aria-pressed tells it.
Keys: Enter and Space press and release it, as a native button's click; a non-native
Toggle (nativeButton={false}) clicks on Enter's key down and Space's key up, and Space does
not scroll.
In a ToggleGroup: it is pressed while the group's value holds its value (required
there); pressed and defaultPressed are ignored, onPressedChange still reports before the
group's onValueChange.
In a composite (a ToggleGroup, a Toolbar): it takes the composite's roving tabindex, and
the arrow keys reach it; a disabled Toggle is natively disabled and skipped.
Disabled: it ignores presses and keys; a disabled ToggleGroup, Toolbar or Toolbar.Group
disables it too. It never submits a form (type="button").
It also takes what the primitive contract gives: render
(Vue: as and the render slot), a class and a style, a ref, and any attribute, which it
forwards. Vue binds them as v-model:pressed and @pressed-change; Angular as [(pressed)] and
(pressedChangeDetails) ({ value, details }); in a ToggleGroup only @pressed-change and
(pressedChangeDetails) report (no update:pressed, no pressedChange). Vue and Angular take the click, pointer, key and
focus listeners as native events (@click, (click)).