<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DatePicker/init(selection:displayedComponents:label:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI10DatePickerV9selection19displayedComponents5labelACyxGAA7BindingVy10Foundation0C0VG_AA0cdG0VxyXEtcfc"
  },
  "title" : "init(selection:displayedComponents:label:)"
}
-->

# init(selection:displayedComponents:label:)

Creates an instance that selects a `Date` with an unbounded range.

```
nonisolated init(selection: Binding<Date>, displayedComponents: DatePicker<Label>.Components = [.hourAndMinute, .date], @ContentBuilder label: () -> Label)
```

## Parameters

`selection`

The date value being displayed and selected.

`displayedComponents`

The date components that user is able to
view and edit. Defaults to `[.hourAndMinute, .date]`. On watchOS,
if `.hourAndMinute` or `.hourMinuteAndSecond` are included with
`.date`, only `.date` is displayed.

`label`

A view that describes the use of the date.

---

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)