How to configure a macOS toolbar to have items only in the sidebar area

Generated on 7/31/2024

1 search

To configure a macOS toolbar to have items only in the sidebar area, you can use the new itemidentifiers property introduced in macOS Sequoia. This property allows you to set the toolbar's item identifiers programmatically, which automatically handles the minimal additions and removals for you.

Here are the steps to achieve this:

  1. Set the itemidentifiers Property: Use the itemidentifiers property to specify which items should be in the toolbar. This will ensure that only the specified items are displayed.

  2. Disable User Customization: If you want to ensure that the toolbar items remain fixed and are not customizable by the user, make sure that allows user customization is disabled. This will prevent any user changes from overriding your specified configuration.

  3. Use the is hidden Property: You can conditionally hide and show toolbar items using the new is hidden property. Hidden items will still appear in customization options, allowing users to choose where they want them to appear when made visible.

For more detailed information, you can refer to the session What’s new in AppKit (15:16).

Relevant Sessions