---
title: PDFAnnotationButtonWidget
framework: pdfkit
role: symbol
role_heading: Class
path: pdfkit/pdfannotationbuttonwidget
---

# PDFAnnotationButtonWidget

A PDFAnnotationButtonWidget object provides user interactivity on a page of a PDF document. There are three types of buttons available: push button, radio button, and checkbox.

## Declaration

```swift
class PDFAnnotationButtonWidget
```

## Overview

Overview PDFAnnotationButtonWidget inherits general annotation behavior from the PDFAnnotation class. If you use a PDFAnnotationButtonWidget object, your application must handle hit testing, unless you are simply using PDFView to display content. This is because PDFView automatically handles hit testing for you.

## Topics

### Getting and Setting the Control Type

- [controlType()](pdfkit/pdfannotationbuttonwidget/controltype().md)
- [setControlType(_:)](pdfkit/pdfannotationbuttonwidget/setcontroltype(_:).md)

### Getting and Setting the Control’s State

- [state()](pdfkit/pdfannotationbuttonwidget/state().md)
- [setState(_:)](pdfkit/pdfannotationbuttonwidget/setstate(_:).md)

### Getting and Setting the Control’s Appearance

- [backgroundColor()](pdfkit/pdfannotationbuttonwidget/backgroundcolor().md)
- [setBackgroundColor(_:)](pdfkit/pdfannotationbuttonwidget/setbackgroundcolor(_:).md)

### Getting and Setting the Control Label Font Attributes

- [font()](pdfkit/pdfannotationbuttonwidget/font().md)
- [setFont(_:)](pdfkit/pdfannotationbuttonwidget/setfont(_:).md)
- [fontColor()](pdfkit/pdfannotationbuttonwidget/fontcolor().md)
- [setFontColor(_:)](pdfkit/pdfannotationbuttonwidget/setfontcolor(_:).md)

### Getting and Setting the Control Label Text

- [caption()](pdfkit/pdfannotationbuttonwidget/caption().md)
- [setCaption(_:)](pdfkit/pdfannotationbuttonwidget/setcaption(_:).md)

### Managing Radio Button Behavior

- [allowsToggleToOff()](pdfkit/pdfannotationbuttonwidget/allowstoggletooff().md)

### Managing Control State Values and Form Fields

- [onStateValue()](pdfkit/pdfannotationbuttonwidget/onstatevalue().md)
- [setOnStateValue(_:)](pdfkit/pdfannotationbuttonwidget/setonstatevalue(_:).md)
- [fieldName()](pdfkit/pdfannotationbuttonwidget/fieldname().md)
- [setFieldName(_:)](pdfkit/pdfannotationbuttonwidget/setfieldname(_:).md)

### Constants

- [PDFWidgetControlType](pdfkit/pdfwidgetcontroltype.md)

### Instance Methods

- [setAllowsToggleToOff(_:)](pdfkit/pdfannotationbuttonwidget/setallowstoggletooff(_:).md)

## Relationships

### Inherits From

- [PDFAnnotation](pdfkit/pdfannotation.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Deprecated Annotation Types

- [PDFAnnotationChoiceWidget](pdfkit/pdfannotationchoicewidget.md)
- [PDFAnnotationCircle](pdfkit/pdfannotationcircle.md)
- [PDFAnnotationFreeText](pdfkit/pdfannotationfreetext.md)
- [PDFAnnotationInk](pdfkit/pdfannotationink.md)
- [PDFAnnotationLine](pdfkit/pdfannotationline.md)
- [PDFAnnotationLink](pdfkit/pdfannotationlink.md)
- [PDFAnnotationMarkup](pdfkit/pdfannotationmarkup.md)
- [PDFAnnotationPopup](pdfkit/pdfannotationpopup.md)
- [PDFAnnotationSquare](pdfkit/pdfannotationsquare.md)
- [PDFAnnotationStamp](pdfkit/pdfannotationstamp.md)
- [PDFAnnotationText](pdfkit/pdfannotationtext.md)
- [PDFAnnotationTextWidget](pdfkit/pdfannotationtextwidget.md)
