TechnologiesSwiftUILists and Collections

ListItemTint struct

iOSmacOStvOSwatchOSvisionOSiOS 14.0+✓ renders

A tint effect configuration that you can apply to content in a list.

How it works

A ListItemTint describes how a list row should color its tintable content — the colorized glyph of an icon, a selection accent, or a swipe control — when it appears inside a List. Rather than overriding every child view's color by hand, you hand the list a single tint value and let it decide which elements to tint and how to blend that color with the row's current state. Reach for it when you want per-row accents that read as deliberate list styling rather than ad-hoc foreground coloring, and when you want the system to keep honoring the user's accent and appearance settings where appropriate.

  1. Apply a tint with listItemTint(_:)

    The primary entry point is the listItemTint(_:) modifier, which you attach to a row to set the ListItemTint for that item's tintable content. In the example each Label carries its own call — .listItemTint(.yellow), .listItemTint(.red), and .listItemTint(.green) — so every row in the List resolves its accent independently.

  2. Tint the row's symbolic content

    ListItemTint targets the parts of a row the system considers tintable, most visibly an SF Symbol rendered by Label(_:systemImage:). Here the colored glyphs star.fill, flag.fill, and checkmark.circle.fill pick up the yellow, red, and green tints respectively, so the icon — not the surrounding label text — reflects the supplied color.

  3. Choose a fixed tint

    Pass a concrete Color to lock a row to an explicit accent regardless of the user's accent settings. The .yellow, .red, and .green values are fixed tints in this form, giving each row a stable, intentional color that won't shift with the system accent.

  4. Opt rows into the user's accent

    ListItemTint also offers monochrome and accent-following behaviors so a row can defer to the appearance the system would normally apply. Where the demo uses a literal Color, you could instead resolve to the user's chosen accent so the tint stays consistent with the rest of the interface — useful when you want emphasis without dictating a specific hue.

Try it — Change .listItemTint(.yellow) on the Favorites row to .listItemTint(.blue) and watch only the star.fill glyph recolor while the other rows keep their own tints.

Example & preview

Press Run live & edit to compile it in your browser — then edit the Swift on the left and the preview re-renders live.

ListItemTint.swift
struct ListItemTintDemo: View {
    var body: some View {
        List {
            Label("Favorites", systemImage: "star.fill")
                .listItemTint(.yellow)
            Label("Flagged", systemImage: "flag.fill")
                .listItemTint(.red)
            Label("Synced", systemImage: "checkmark.circle.fill")
                .listItemTint(.green)
        }
    }
}
Live preview
Favorites Flagged Synced
Favorites Flagged Synced
swift → lexer → parser → sema → uiir → canvas Open in Studio ↗
What's new in SwiftUI 27 →