iPhone SwiftUI layouts
Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.
201elements
List
SidebarListStyle
The list style that describes the behavior and appearance of a sidebar list.
Explore SidebarListStyle on iPhone in portrait, with SwiftUI code and Apple API documentation.
SwiftUI code
List {
Section {
Toggle("Toggle", isOn: .constant(true))
TextField("TextField", text: .constant(""))
Button("Button", action: action)
Picker("Picker", selection: .constant(0)) {
Text("Option 1").tag(0)
}
}
Text("Foo")
Section {
Text("Bar1")
Text("Bar2")
} header: {
Text("Header")
} footer: {
Text("Footer")
}
}
.listStyle(.sidebar)Compatibility
iOS 14.0+ iPadOS 14.0+ macOS 10.15+ visionOS 1.0+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for SidebarListStyle.