inputs/DSDatePicker
DSDatePicker
inputsDate (and optional time) picker with a calendar grid popover. Wraps the native DatePicker with DS token styling.
iOS 17+macOS 14+
Purpose
Date selection in forms: booking dates, deadlines, birthdays, scheduled tasks.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| selectionreq | Binding<Date> | โ | Bound date value. |
| label | String? | nil | Field label. |
| displayedComponents | DatePickerComponents | .date | .date, .hourAndMinute, or both. |
| range | ClosedRange<Date>? | nil | Restricts selectable dates. |
| placeholder | String | "Select a date" | Placeholder before a date is chosen. |
Examples
Task deadline picker
Date field in a task creation form.
swift
DSDatePicker(
selection: $taskDeadline,
label: "Due date",
range: Date.now...,
displayedComponents: .date
)