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

# setBadgeText(_:)

Sets the badge text for the toolbar item.

```
func setBadgeText(_ badgeText: String?)
```

## Parameters

`badgeText`

String to display on the badge. Pass `nil` to remove the badge.

---

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)