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

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.