<!--
{
  "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/List/init(_:id:rowContent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ListVAAs5NeverORszrlE_2id10rowContentACyAeA7ForEachVys15LazyMapSequenceVy7IndicesSlQyd__5IndexSlQyd___qd_0_tGqd_0_qd_1_GGAA7BindingVyqd__G_s7KeyPathCy7ElementSTQyd__qd_0_Gqd_1_ATyAYGctcAQRs_SMRd__SkRd__SHRd_0_AA4ViewRd_1_SHAORQr1_lufc::OverloadGroup"
  },
  "title" : "init(_:id:rowContent:)"
}
-->

# init(_:id:rowContent:)

Creates a list that identifies its rows based on a key path to the
identifier of the underlying data.

```
@export(implementation) nonisolated init<Data, ID, RowContent>(_ data: Binding<Data>, id: KeyPath<Data.Element, ID>, @ContentBuilder rowContent: @escaping (Binding<Data.Element>) -> RowContent) where Content == ForEach<LazyMapSequence<Data.Indices, (Data.Index, ID)>, ID, RowContent>, Data : MutableCollection, Data : RandomAccessCollection, ID : Hashable, RowContent : View, Data.Index : Hashable
```

## Parameters

`data`

The data for populating the list.

`id`

The key path to the data model’s identifier.

`rowContent`

A content builder that creates the view for a single row of
the list.

---

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)