<!--
{
  "availability" : [
    "macOS: 13.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ToolbarItemPlacement/accessoryBar(id:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI20ToolbarItemPlacementV12accessoryBar2idACx_tSHRzlFZ"
  },
  "title" : "accessoryBar(id:)"
}
-->

# accessoryBar(id:)

Creates a unique accessory bar placement.

```
@backDeployed(before: macOS 14.0)
static func accessoryBar<ID>(id: ID) -> ToolbarItemPlacement where ID : Hashable
```

## Parameters

`id`

A unique identifier for this placement.

## Discussion

On macOS, items with an accessory bar placement are placed in a section
below the title bar and toolbar area of the window. Each separate
identifier will correspond to a separate accessory bar that is added to
this area.

```
extension ToolbarItemPlacement {
    static let favoritesBar = accessoryBar(id: "com.example.favorites")
}
...
BrowserView()
    .toolbar {
        ToolbarItem(placement: .favoritesBar) {
            FavoritesBar()
        }
    }
```

---

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)