<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/listRowBackground(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE17listRowBackgroundyQrqd__SgAaBRd__lF"
  },
  "title" : "listRowBackground(_:)"
}
-->

# listRowBackground(_:)

Places a custom background view behind a list row item.

```
nonisolated func listRowBackground<V>(_ view: V?) -> some View where V : View
```

## Parameters

`view`

The [`View`](/documentation/SwiftUI/View) to use as the background behind the list
row view.

## Return Value

A list row view with `view` as its background view.

## Discussion

Use `listRowBackground(_:)` to place a custom background view behind a
list row item.

In the example below, the `Flavor` enumeration provides content for list
items. The SwiftUI [`ForEach`](/documentation/SwiftUI/ForEach) structure computes views for each element
of the `Flavor` enumeration and extracts the raw value of each of its
elements using the resulting text to create each list row item. The
`listRowBackground(_:)` modifier then places the view you supply behind
each of the list row items:

```
struct ContentView: View {
    enum Flavor: String, CaseIterable, Identifiable {
        var id: String { self.rawValue }
        case vanilla, chocolate, strawberry
    }

    var body: some View {
        List {
            ForEach(Flavor.allCases) {
                Text($0.rawValue)
                    .listRowBackground(Ellipse()
                                        .background(Color.clear)
                                        .foregroundColor(.purple)
                                        .opacity(0.3)
                    )
            }
        }
    }
}
```

![A screenshot showing the placement of an image as the background to](images/com.apple.SwiftUI/SwiftUI-View-listRowBackground@2x.png)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)