<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ToolbarItemPlacement",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI20ToolbarItemPlacementV"
  },
  "title" : "ToolbarItemPlacement"
}
-->

# ToolbarItemPlacement

A structure that defines the placement of a toolbar item.

```
struct ToolbarItemPlacement
```

## Overview

There are two types of placements:

- Semantic placements, such as [`principal`](/documentation/SwiftUI/ToolbarItemPlacement/principal) and
  [`navigation`](/documentation/SwiftUI/ToolbarItemPlacement/navigation), denote the intent of the
  item being added. SwiftUI determines the appropriate placement for
  the item based on this intent and its surrounding context, like the
  current platform.
- Positional placements, such as
  [`navigationBarLeading`](/documentation/SwiftUI/ToolbarItemPlacement/navigationBarLeading), denote a precise
  placement for the item, usually for a particular platform.

In iOS, iPadOS, and macOS, the system uses the space available to the
toolbar when determining how many items to render in the toolbar. If not
all items fit in the available space, an overflow menu may be created
and remaining items placed in that menu.

## Topics

### Getting semantic placement

[`automatic`](/documentation/SwiftUI/ToolbarItemPlacement/automatic)

A placement the system positions automatically.

[`principal`](/documentation/SwiftUI/ToolbarItemPlacement/principal)

A placement for the principal item section.

[`status`](/documentation/SwiftUI/ToolbarItemPlacement/status)

A placement for items that represents a change in status.

### Getting placement for specific actions

[`primaryAction`](/documentation/SwiftUI/ToolbarItemPlacement/primaryAction)

A placement for the primary action.

[`secondaryAction`](/documentation/SwiftUI/ToolbarItemPlacement/secondaryAction)

A placement for secondary actions.

[`confirmationAction`](/documentation/SwiftUI/ToolbarItemPlacement/confirmationAction)

A placement for confirmation actions in a modal interface.

[`cancellationAction`](/documentation/SwiftUI/ToolbarItemPlacement/cancellationAction)

A placement for cancellation actions in a modal interface.

[`destructiveAction`](/documentation/SwiftUI/ToolbarItemPlacement/destructiveAction)

A placement for destructive actions in a modal interface.

[`navigation`](/documentation/SwiftUI/ToolbarItemPlacement/navigation)

A placement for navigation actions.

### Getting explicit placement

[`topBarLeading`](/documentation/SwiftUI/ToolbarItemPlacement/topBarLeading)

A placement for items in the leading edge of the top bar.

[`topBarTrailing`](/documentation/SwiftUI/ToolbarItemPlacement/topBarTrailing)

A placement for items in the trailing edge of the top bar.

[`topBarPinnedTrailing`](/documentation/SwiftUI/ToolbarItemPlacement/topBarPinnedTrailing)

A placement that pins the item to the trailing edge of the toolbar.

[`bottomBar`](/documentation/SwiftUI/ToolbarItemPlacement/bottomBar)

A placement for items in the bottom toolbar.

[`bottomOrnament`](/documentation/SwiftUI/ToolbarItemPlacement/bottomOrnament)

A placement for items in an ornament under the window.

[`keyboard`](/documentation/SwiftUI/ToolbarItemPlacement/keyboard)

A placement for items in the keyboard section.

[`accessoryBar(id:)`](/documentation/SwiftUI/ToolbarItemPlacement/accessoryBar(id:))

Creates a unique accessory bar placement.

### Deprecated symbols

[`init(id:)`](/documentation/SwiftUI/ToolbarItemPlacement/init(id:))

Creates a custom accessory bar item placement.

[`navigationBarLeading`](/documentation/SwiftUI/ToolbarItemPlacement/navigationBarLeading)

Places the item in the leading edge of the navigation bar.

[`navigationBarTrailing`](/documentation/SwiftUI/ToolbarItemPlacement/navigationBarTrailing)

Places the item in the trailing edge of the navigation bar.



---

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)