<!--
{
  "documentType" : "article",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/menu-tags",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Menu tags"
}
-->

# Menu tags

Constants for identifying special menu items in the search-menu template.

## Discussion

When an `NSSearchFieldCell` object dynamically constructs the actual search menu from this template, it shows or hides the tagged items as directed.

## Topics

### Constants

[`class var recentsTitleMenuItemTag: Int`](/documentation/AppKit/NSSearchField/recentsTitleMenuItemTag)

The menu item that provides the title of the menu group for recent search strings.

[`class var recentsMenuItemTag: Int`](/documentation/AppKit/NSSearchField/recentsMenuItemTag)

The location of recent search strings in the “recents” menu group.

[`class var clearRecentsMenuItemTag: Int`](/documentation/AppKit/NSSearchField/clearRecentsMenuItemTag)

The menu item for clearing the current set of recent string searches in the menu.

[`class var noRecentsMenuItemTag: Int`](/documentation/AppKit/NSSearchField/noRecentsMenuItemTag)

The menu item that describes a lack of recent search strings.



---

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)