How to remove inset in SwiftUI list rows?
Asked on 06/12/2025
1 search
To remove the inset in SwiftUI list rows, you can use the listRowInsets
modifier. This modifier allows you to customize or remove the default insets applied to list rows. Here's an example of how you can use it:
List {
ForEach(items, id: \.self) { item in
Text(item)
.listRowInsets(EdgeInsets()) // Removes the insets
}
}
In this example, EdgeInsets()
is used to remove all insets, making the list rows extend to the full width of the list. You can adjust the EdgeInsets
values to customize the insets as needed.
For more detailed information on customizing SwiftUI containers, you might find the session Demystify SwiftUI containers helpful, which covers customization options in SwiftUI.

Demystify SwiftUI containers
Learn about the capabilities of SwiftUI container views and build a mental model for how subviews are managed by their containers. Leverage new APIs to build your own custom containers, create modifiers to customize container content, and give your containers that extra polish that helps your apps stand out.

What’s new in UIKit
Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.

Get started with Dynamic Type
Dynamic Type lets people choose their preferred text size across the system and all of their apps. To help you get started supporting Dynamic Type, we’ll cover the fundamentals: How it works, how to find issues with scaling text in your app, and how to take practical steps using SwiftUI and UIKit to create a great Dynamic Type experience. We’ll also show how you can best use the Large Content Viewer to make navigation controls accessible to everyone.