--- 
title: Toggle Button (A1)
description: Radio-style group of buttons for a single choice out of many options
category: components
a1Full: true
alias: toggle button group, choice button
components:
- name: NxToggleButtonGroupComponent
  selector: nx-toggle-button-group
  inputs:
    - name: disabled
      desc: "Whether all toggle buttons of the group are disabled. Also set by the bound form control."
      default: input(false, { transform: booleanAttribute })
      type: "InputSignalWithTransform<boolean, unknown>"
    - name: readonly
      desc: "Whether all toggle buttons of the group are readonly. Also set by the bound form control."
      default: input(false, { transform: booleanAttribute })
      type: "InputSignalWithTransform<boolean, unknown>"
    - name: required
      desc: "Whether a selection is required. Only sets the aria attribute, validation stays with the form. Also set by the bound form control."
      default: input(false, { transform: booleanAttribute })
      type: "InputSignalWithTransform<boolean, unknown>"
    - name: name
      desc: "Name of the toggle buttons, which is mandatory in conjunction with ngModel. Must be unique per group, otherwise two groups merge into one native radio group (Default: the id of the group)."
      default: input(this.id)
      type: "InputSignal<any>"
    - name: negative
      desc: "Whether the toggle buttons are styled for a dark surface."
      default: input(false, { transform: booleanAttribute })
      type: "InputSignalWithTransform<boolean, unknown>"
    - name: autoGrid
      desc: "Whether the toggle buttons are laid out automatically."
      default: input(true, { transform: booleanAttribute })
      type: "InputSignalWithTransform<boolean, unknown>"
    - name: maxColumns
      desc: "Maximum number of columns of the automatic layout. Unlimited by default."
      default: input<number | null>(null)
      type: "InputSignal<number | null>"
    - name: columnSizing
      desc: "Whether the toggle buttons are as wide as their content or all equally wide."
      default: input<NxToggleButtonColumnSizing>('content')
      type: "InputSignal<'content' | 'equal'>"
  methods:
    - name: setReadonly
      params:
        - name: value
          type: boolean
      returnType: void
    - name: focus
      params:
        - name: options
          type: FocusOptions | undefined
      desc: "Focuses the selected toggle button, or the first one that can be selected."
      returnType: void
- name: NxToggleButtonComponent
  selector: nx-toggle-button
  inputs:
    - name: value
      desc: "Value of the toggle button. Becomes the value of the group when selected."
      default: input<any>(null)
      type: "InputSignal<any>"
    - name: disabled
      desc: "Whether the toggle button is disabled. Also set by the group."
      default: input(false, { transform: booleanAttribute })
      type: "InputSignalWithTransform<boolean, unknown>"
    - name: readonly
      desc: "Whether the toggle button is readonly. Also set by the group."
      default: input(false, { transform: booleanAttribute })
      type: "InputSignalWithTransform<boolean, unknown>"
  methods:
    - name: focus
      params:
        - name: options
          type: FocusOptions | undefined
      desc: "Focuses the toggle button."
      returnType: void
group: Forms & Inputs



---
# Overview
The toggle button is a component of the One Allianz Design System. A `nx-toggle-button-group` holds
any number of `nx-toggle-button`s and behaves like a group of radio buttons: exactly one option can
be selected at a time and the arrow keys move the selection.

**Not to be confused with the [Toggle Button](/documentation/radio-toggle/overview) built from
`nx-radio-toggle`.** That component is the segmented control of the One Allianz Design System: a
small, fixed set of options that are joined into a single bar. Use the toggle button group when the
options are content of their own, when there are many of them, or when they should wrap over
several lines.
