Parameters
The toolbar content to display. Can be a single toolbar item, group of items, or a Group containing multiple items.
A modifier that adds toolbar items to a view.
toolbar(content: ToolbarItem | ToolbarItemGroup | Group): Component;
VStack([
Text("Content")
])
.toolbar(
ToolbarItem(
{ placement: "navigationBarTrailing" },
[
Button("Save", () => console.log("Saved"))
]
)
)
VStack([
Text("Content")
])
.toolbar(
Group([
ToolbarItem(
{ placement: "navigationBarLeading" },
[Button("Cancel", () => console.log("Cancel"))]
),
ToolbarItem(
{ placement: "navigationBarTrailing" },
[Button("Done", () => console.log("Done"))]
)
])
)
VStack([
Text("Content")
])
.toolbar(
ToolbarItemGroup(
{ placement: "bottomBar" },
[
Button("Action 1", () => {}),
Spacer(),
Button("Action 2", () => {}),
Button("Action 3", () => {})
]
)
)