# togglebutton

```ts
import { ToggleButtonModule } from '@anguless/angulux/togglebutton';
```

## ToggleButton

`agl-toggleButton, agl-togglebutton, agl-toggle-button` — component

Inherits every input, output and slot of `BaseEditableHolder` — see [baseeditableholder.md](baseeditableholder.md).

ToggleButton is used to select a boolean value using a button.

| Input | Type | Default | Description |
| --- | --- | --- | --- |
| `onLabel` | `string` | _not documented_ | Label for the on state. |
| `offLabel` | `string` | _not documented_ | Label for the off state. |
| `onIcon` | `string \| undefined` | _not documented_ | Icon for the on state. |
| `offIcon` | `string \| undefined` | _not documented_ | Icon for the off state. |
| `ariaLabel` | `string \| undefined` | _not documented_ | Defines a string that labels the input for accessibility. |
| `ariaLabelledBy` | `string \| undefined` | _not documented_ | Establishes relationships between the component and label(s) where its value should be one or more element IDs. |
| `styleClass` | `string \| undefined` | _not documented_ | Style class of the element. **Deprecated:** since v20.0.0, use `class` instead. |
| `inputId` | `string \| undefined` | _not documented_ | Identifier of the focus input to match a label defined for the component. |
| `tabindex` | `number \| undefined` | _not documented_ | Index of the element in tabbing order. |
| `iconPos` | `'left' \| 'right'` | _not documented_ | Position of the icon. |
| `autofocus` | `boolean \| undefined` | _not documented_ | When present, it specifies that the component should automatically get focus on load. |
| `size` | `'large' \| 'small'` | _not documented_ | Defines the size of the component. |
| `allowEmpty` | `boolean \| undefined` | _not documented_ | Whether selection can not be cleared. |
| `fluid` | `` | `undefined` | Spans 100% width of the container when enabled. |

| Output | Type | Description |
| --- | --- | --- |
| `onChange` | `EventEmitter<ToggleButtonChangeEvent>` | Callback to invoke on value change. |

| Slot | Read as | Description |
| --- | --- | --- |
| `<ng-template #icon>` | `iconTemplate` | Custom icon template. |
| `<ng-template #content>` | `contentTemplate` | Custom content template. |
