---
title: "listRowBackground(_:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/listrowbackground(_:)"
---

# listRowBackground(_:)

Places a custom background view behind a list row item.

## Declaration

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

```

## Parameters

- `view`: The doc://com.apple.SwiftUI/documentation/SwiftUI/View to use as the background behind the list row view.

## Return Value

Return Value A list row view with view as its background view.

## Discussion

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 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)                     )             }         }     } }

## See Also

### Configuring backgrounds

- [alternatingRowBackgrounds(_:)](swiftui/view/alternatingrowbackgrounds(_:).md)
- [AlternatingRowBackgroundBehavior](swiftui/alternatingrowbackgroundbehavior.md)
- [backgroundProminence](swiftui/environmentvalues/backgroundprominence.md)
- [BackgroundProminence](swiftui/backgroundprominence.md)
