---
title: "text(_:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nsitembadge-swift.struct/text(_:)"
---

# text(_:)

Creates a badge displaying a text.

## Declaration

```swift
static func text(_ text: String) -> NSItemBadge
```

## Parameters

- `text`: The text to be displayed inside the badge.

## Return Value

Return Value A new NSItemBadge instance with the specified text.
