<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/tabViewCustomization(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE03tabC13CustomizationyQrAA7BindingVyAA03TabcE0VGSgF"
  },
  "title" : "tabViewCustomization(_:)"
}
-->

# tabViewCustomization(_:)

Specifies the customizations to apply to the sidebar representation
of the tab view.

```
nonisolated func tabViewCustomization(_ customization: Binding<TabViewCustomization>?) -> some View
```

## Parameters

`customization`

The customization object to store
user customization in.

## Discussion

Only the [`sidebarAdaptable`](/documentation/SwiftUI/TabViewStyle/sidebarAdaptable) style supports
supports customization. Specifying a non-nil [`TabViewCustomization`](/documentation/SwiftUI/TabViewCustomization)
object using this modifier enables customization.

By default, if a person hasn’t made customizations, tabs appear
according to the default builder visibilities and sections appear in
the order you declare in the tab view’s tab builder.

You can change the default visibility by using the
[`defaultVisibility(_:for:)`](/documentation/SwiftUI/TabContent/defaultVisibility(_:for:)) with a
[`sidebar`](/documentation/SwiftUI/AdaptableTabBarPlacement/sidebar) placement.

You can change the default section order by changing the order
in the builder. If there’s an existing persisted customization,
reset the order by calling
[`resetTabOrder()`](/documentation/SwiftUI/TabViewCustomization/SectionCustomization/resetTabOrder())
when you change the order.

All tabs and tab sections that support customization need to have
a customization ID. You can mark a tab as being non-customizable
by specifying a [`disabled`](/documentation/SwiftUI/TabCustomizationBehavior/disabled) behavior
in all adaptable tab bar placements
using [`customizationBehavior(_:for:)`](/documentation/SwiftUI/TabContent/customizationBehavior(_:for:)).

On macOS, a default interaction is provided for reordering sections but
not for controlling the visibility of individual tabs. A custom
experience should be provided if desired by setting the visibility of
the tab on the customization.

The following code example uses `@AppStorage` to automatically persist
any visibility or section order customizations a person makes.

```
@AppStorage
private var customization: TabViewCustomization

TabView {
    Tab("Home", systemImage: "house") {
        MyHomeView()
    }
    .customizationID("com.myApp.home")

    Tab("Reports", systemImage: "chart.bar") {
        MyReportsView()
    }
    .customizationID("com.myApp.reports")

    TabSection("Categories") {
        Tab("Climate", systemImage: "fan") {
            ClimateView()
        }
        .customizationID("com.myApp.climate")

        Tab("Lights", systemImage: "lightbulb") {
            LightsView()
        }
        .customizationID("com.myApp.lights")
    }
    .customizationID("com.myApp.browse")
}
.tabViewStyle(.sidebarAdaptable)
.tabViewCustomization($customization)
```

---

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)