How do I create a Tab View Bottom Accessory?

Asked on 06/11/2025

1 search

To create a Tab View Bottom Accessory in a SwiftUI app, you can use the Tab View Bottom accessory modifier. This allows you to place a view above the tab bar, taking advantage of the extra space provided by the tab bar's collapsing behavior. Here's a brief overview of how you can implement this:

  1. Create the Accessory View: Place your additional controls or content in a view that you want to display as a bottom accessory.

  2. Use the Modifier: Apply the Tab View Bottom accessory modifier to your view. This will position your accessory view above the tab bar.

  3. Adjust for Collapsing Behavior: Read the Tab View button accessory placement from the environment and adjust the content of your accessory when it collapses into the Tab bar area.

For more detailed guidance, you can refer to the session Build a SwiftUI app with the new design (05:35) from WWDC 2025.