<!--
{
  "availability" : [
    "iOS: 14.0.0 - 27.0.0",
    "iPadOS: 14.0.0 - 27.0.0",
    "macCatalyst: 14.0.0 - 27.0.0",
    "macOS: 11.0.0 - 27.0.0",
    "tvOS: 14.0.0 - 27.0.0",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/ToolbarItem/init(id:placement:showsByDefault:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11ToolbarItemVAASSRszrlE2id9placement14showsByDefault7contentACySSq_GSS_AA0cD9PlacementVSbq_yXEtcfc"
  },
  "title" : "init(id:placement:showsByDefault:content:)"
}
-->

# init(id:placement:showsByDefault:content:)

Creates a toolbar item with the specified placement and content,
which allows for user customization.

```
nonisolated init(id: String, placement: ToolbarItemPlacement = .automatic, showsByDefault: Bool, @ContentBuilder content: () -> Content)
```

## Parameters

`id`

A unique identifier for this item.

`placement`

Which section of the toolbar
the item should be placed in.

`showsByDefault`

Whether the item appears by default in the toolbar,
or only shows if the user explicitly adds it via customization.

`content`

The content of the item.

---

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)