---
title: NSButton.ButtonType.toggle
framework: appkit
role: symbol
role_heading: Case
path: appkit/nsbutton/buttontype/toggle
---

# NSButton.ButtonType.toggle

A button that switches between its normal and alternate content on each click.

## Declaration

```swift
case toggle
```

## Discussion

Discussion When the value of state is off, the button displays its normal content, such as its image or title. When state has any other value, the button displays its alternate content, such as its alternateImage or alternateTitle instead. If the button has no alternate content to display, it may instead draw its normal content using an illuminated effect. This type of button is best for controlling a Boolean state within your application, while also providing a visual indication of that state. This option corresponds to the Toggle type in Interface Builder’s Attributes Inspector.

## See Also

### Configuring Button Behavior

- [NSButton.ButtonType.momentaryPushIn](appkit/nsbutton/buttontype/momentarypushin.md)
- [NSButton.ButtonType.momentaryLight](appkit/nsbutton/buttontype/momentarylight.md)
- [NSButton.ButtonType.momentaryChange](appkit/nsbutton/buttontype/momentarychange.md)
- [NSButton.ButtonType.pushOnPushOff](appkit/nsbutton/buttontype/pushonpushoff.md)
- [NSButton.ButtonType.onOff](appkit/nsbutton/buttontype/onoff.md)
- [NSButton.ButtonType.switch](appkit/nsbutton/buttontype/switch.md)
- [NSButton.ButtonType.radio](appkit/nsbutton/buttontype/radio.md)
- [NSButton.ButtonType.accelerator](appkit/nsbutton/buttontype/accelerator.md)
- [NSButton.ButtonType.multiLevelAccelerator](appkit/nsbutton/buttontype/multilevelaccelerator.md)
