<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SafariServices",
  "identifier" : "/documentation/SafariServices/SFSafariToolbarItem",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Safari Services"
    ],
    "preciseIdentifier" : "c:objc(cs)SFSafariToolbarItem"
  },
  "title" : "SFSafariToolbarItem"
}
-->

# SFSafariToolbarItem

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

```
class SFSafariToolbarItem
```

## 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:)`](/documentation/SafariServices/SFSafariExtensionHandling/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:`](/documentation/SafariServices/SFSafariToolbarItem/setEnabled(_:withBadgeText:))

Sets the enabled state and the badge text for the toolbar item.

[`-  setBadgeText:`](/documentation/SafariServices/SFSafariToolbarItem/setBadgeText(_:))

Sets the badge text for the toolbar item.

[`-  setEnabled:`](/documentation/SafariServices/SFSafariToolbarItem/setEnabled(_:))

Sets whether the toolbar item is enabled.

[`-  setImage:`](/documentation/SafariServices/SFSafariToolbarItem/setImage(_:))

Sets the image displayed in the toolbar button.

[`-  setLabel:`](/documentation/SafariServices/SFSafariToolbarItem/setLabel(_:))

### Instance Methods

[`-  showPopover`](/documentation/SafariServices/SFSafariToolbarItem/showPopover())

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)