Skip to content
OGE logoOGE

Toggle Controls

Bare (chrome-free) boolean and choice controls: <oge-check-box> (two- or three-state), <oge-switch> (on/off with localized track text) and <oge-radio-group> (WAI-ARIA radiogroup with roving tabindex). All three share the select box expression vocabulary where items are involved and bind via [(value)], Signal Forms or reactive forms.

check box switch radio group signal forms

Check Box

A real (visually hidden) native checkbox drives semantics — label clicks, Space and aria-checked='mixed' come for free. value is boolean | null: null always renders the indeterminate dash, and threeState lets users cycle into it.

boolean | null threeState indeterminate
select all: null (indeterminate)

Switch

A native <button role='switch'> with aria-checked and a sliding thumb. Track texts default to the localized switchOn/switchOff messages ('ON'/'OFF'); override per instance or pass empty strings to hide them. The reference swipe gesture is deliberately not replicated.

role=switch onText / offText messages

Radio Group

Flat items with displayExpr/valueExpr/disabledExpr; layout switches column/row. Arrows move focus and selection (wrapping, disabled skipped, RTL-aware) per the WAI-ARIA radio-group pattern.

displayExpr / valueExpr layout roving tabindex
plan: team

Toggle Group

oge-toggle-group is the segmented control as a form editor — label, hint, validation and [formField] / formControl, which oge-button-group (an action control) does not carry. single is the WAI-ARIA radio group: arrows move focus and selection and the selected segment cannot be pressed off; multiple renders aria-pressed toggle buttons with an array value in items order.

selectionMode radiogroup aria-pressed
Alignment
Delivery days
Pick one or more
align: left · days: ["Mon","Thu"]

Forms integration

All three implement Signal Forms' FormValueControl and the classic CVA (constructor-assignment pattern) — [formField], formControl and ngModel all work. valueCommitted carries previousValue and the originating event.

FormValueControl CVA valueCommitted
See the validation page for live Signal Forms demos of the shared state inputs.

Keyboard & accessibility

  • Check box: native semantics — Space toggles, label clicks work, aria-checked="mixed" via the native indeterminate property.
  • Switch: Space/Enter toggle the role="switch" button; label feeds aria-label.
  • Radio group: one tab stop (roving tabindex); ↓/→/↑/← move focus and selection with wrap-around, Home/End jump to the edges, disabled items are skipped.
  • Toggle group: one tab stop. Single mode is a radio group (arrows move focus and selection); multiple mode is a group of aria-pressed buttons — arrows move focus, Space/Enter toggle.