mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Adds a `badge` property to `MenuItem` on macOS, backed by AppKit's `NSMenuItemBadge` API (macOS 14+). The property accepts a `MenuItemBadge` object with a `type` (`alerts`, `updates`, `new-items`, or `none`) and an optional `count` or custom `content` string. The badge can be set at construction time or updated dynamically after the item has been added to a menu.
342 B
342 B
MenuItemBadge Object
typestring (optional) - Can be one ofalerts,updates,new-itemsornone. Default isnone.countnumber (optional) - The number of items the badge displays. Cannot be used withtype: 'none'.contentstring (optional) - A custom string to display in the badge. Only usable withtype: 'none'.