---
title: SFSafariToolbarItem
framework: safariservices
role: symbol
role_heading: Class
path: safariservices/sfsafaritoolbaritem
---

# SFSafariToolbarItem

A proxy for a Safari app extension toolbar item in a Safari window.

## Declaration

```swift
class SFSafariToolbarItem
```

## Overview

Overview Your app extension only uses this object when it wants to explicitly set the toolbar item state. Typically, other state changes occur automatically. Safari calls validateToolbarItem(in:validationHandler:) on your app extension handler when changes, such as navigation to a webpage, could affect the state of the toolbar item.

## Topics

### Controlling Toolbar Items

- [setEnabled(_:withBadgeText:)](safariservices/sfsafaritoolbaritem/setenabled(_:withbadgetext:).md)
- [setBadgeText(_:)](safariservices/sfsafaritoolbaritem/setbadgetext(_:).md)
- [setEnabled(_:)](safariservices/sfsafaritoolbaritem/setenabled(_:).md)
- [setImage(_:)](safariservices/sfsafaritoolbaritem/setimage(_:).md)
- [setLabel(_:)](safariservices/sfsafaritoolbaritem/setlabel(_:).md)

### Instance Methods

- [showPopover()](safariservices/sfsafaritoolbaritem/showpopover().md)

### Initializers

- [init(coder:)](safariservices/sfsafaritoolbaritem/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.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)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Contextual menu and toolbar items

- [Using contextual menu and toolbar item keys](safariservices/using-contextual-menu-and-toolbar-item-keys.md)
- [Adjusting settings for a toolbar item](safariservices/adjusting-settings-for-a-toolbar-item.md)
- [Adjusting settings for contextual menu items](safariservices/adjusting-settings-for-contextual-menu-items.md)
- [SFSafariExtensionViewController](safariservices/sfsafariextensionviewcontroller.md)
