SwiftUI.cc
SwiftUI collection

Lists & Grids SwiftUI reference

Focused SwiftUI lists & grids pages with original examples, usage guidance, and implementation notes.

Showing 1-9 of 9 reference pages

Lazy stacks create children only as they scroll into view and support section headers that pin to the edge while their section passes.

4 min readOpen

LazyVGrid scrolls vertically and fills columns described by GridItem: fixed, flexible, or adaptive — the three words that define every grid design.

5 min readOpen

LazyHGrid scrolls horizontally and fills rows defined by GridItem heights — the sideways twin of LazyVGrid for shelf and timetable layouts.

4 min readOpen

List renders platform-native rows from data. ForEach adds onDelete and onMove editing, and a selection binding turns rows tappable with single or multi-select.

5 min readOpen

Restyle List without leaving it: listRowBackground, listRowInsets, separator visibility and tint, listRowSpacing, listSectionSpacing, and scrollContentBackground.

5 min readOpen

swipeActions adds leading and trailing buttons with full-swipe control, refreshable wires async pull-to-refresh, and badge annotates rows with counts.

4 min readOpen

OutlineGroup and List(children:) render tree-shaped data with disclosure triangles — file browsers, org charts, and nested categories without manual recursion.

4 min readOpen

Table presents multi-column data with selectable rows and sortable headers on Mac and iPad, collapsing gracefully to its first column on iPhone.

4 min readOpen

ContentUnavailableView standardizes empty, error, and no-results screens with an icon, title, description, and action buttons — including the built-in search variant.

3 min readOpen