<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/List/init(_:children:rowContent:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ListVAAs5NeverORszrlE_8children10rowContentACyAeA12OutlineGroupVyAA7BindingVyqd__G7ElementST_2IDQYd__qd_0_qd_0_AA010DisclosureI0Vyqd_0_AA0H16SubgroupChildrenVGGGAL_s15WritableKeyPathCyAMSTQyd__qd__SgGqd_0_AKyAYGctcAURs_SMRd__SkRd__AA4ViewRd_0_s12IdentifiableAYRQr0_lufc::OverloadGroup"
  },
  "title" : "init(_:children:rowContent:)"
}
-->

# init(_:children:rowContent:)

Creates a hierarchical list that computes its rows on demand from a
binding to an underlying collection of identifiable data.

```
nonisolated init<Data, RowContent>(_ data: Binding<Data>, children: WritableKeyPath<Data.Element, Data?>, @ContentBuilder rowContent: @escaping (Binding<Data.Element>) -> RowContent) where Content == OutlineGroup<Binding<Data>, Data.Element.ID, RowContent, RowContent, DisclosureGroup<RowContent, OutlineSubgroupChildren>>, Data : MutableCollection, Data : RandomAccessCollection, RowContent : View, Data.Element : Identifiable
```

## Parameters

`data`

A collection of identifiable data for computing the list.

`children`

A key path to a property whose non-`nil` value gives the
children of `data`. A non-`nil` but empty value denotes a node capable
of having children that is currently childless, such as an empty
directory in a file system. On the other hand, if the property at the
key path is `nil`, then `data` is treated as a leaf node in the tree,
like a regular file in a file system.

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