
Truly native date picker UI leveraging system pickers, auto-inheriting app theming; asynchronous suspend-style APIs for single or range selection, plus UI toolkit helper.
A Kotlin Multiplatform library that provides a truly native Date and Time Picker experience for both Android and iOS. This library uses platform-specific components that automatically inherit your application's theme and branding.
MaterialDatePicker/MaterialTimePicker on Android and Apple's UIDatePicker on iOS.suspend functions that return selected values or null if cancelled.rememberDatePicker() and rememberTimePicker() helpers for seamless integration.| Android | iOS |
|---|---|
![]() |
![]() |
Add the dependency to your commonMain source set in your build.gradle.kts:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.ktsnippetbyshubham:kmp-native-datepicker:1.0.2")
}
}
}val datePicker = rememberDatePicker()
val scope = rememberCoroutineScope()
Button(onClick = {
scope.launch {
val selectedMillis = datePicker.pickDate(
title = "Select Birthday"
)
if (selectedMillis != null) {
// Handle selected date
}
}
}) {
Text("Open Date Picker")
}val timePicker = rememberTimePicker()
Button(onClick = {
scope.launch {
val time = timePicker.pickTime(
title = "Select Time",
is24Hour = true
)
if (time != null) {
println("Selected: ${time.hour}:${time.minute}")
}
}
}) {
Text("Open Time Picker")
}Button(onClick = {
scope.launch {
val range = datePicker.pickDateRange(
title = "Select Vacation Dates"
)
if (range != null) {
println("Range: ${range.startDateMillis} - ${range.endDateMillis}")
}
}
}) {
Text("Open Range Picker")
}If you are not using Compose:
val datePicker = DatePickerFactory(context).createDatePicker()val timePicker = TimePickerFactory(context).createTimePicker()val datePicker = DatePickerFactory().createDatePicker()val timePicker = TimePickerFactory().createTimePicker()The library is designed to be "Brand-Aware". You don't need to pass color codes manually.
The pickers follow your MaterialTheme. To change the color, simply update your colorPrimary in your app's theme:
<item name="colorPrimary">#FF5722</item> <!-- Your brand color -->The pickers automatically use the System Global Tint. If you have set a custom tint color for your app's window, the picker buttons and selection highlights will match it automatically.
| Parameter | Type | Description |
|---|---|---|
initialDateMillis |
Long? |
Initial date to show (Default: Now) |
minDateMillis |
Long? |
Minimum selectable date |
maxDateMillis |
Long? |
Maximum selectable date |
title |
String? |
Custom title for the dialog |
doneButtonText |
String? |
Custom label for Done button (iOS only) |
cancelButtonText |
String? |
Custom label for Cancel button (iOS only) |
| Parameter | Type | Description |
|---|---|---|
initialHour |
Int? |
Initial hour (0-23) |
initialMinute |
Int? |
Initial minute (0-59) |
is24Hour |
Boolean |
Whether to use 24-hour format |
title |
String? |
Custom title for the dialog |
doneButtonText |
String? |
Custom label for Done button (iOS only) |
cancelButtonText |
String? |
Custom label for Cancel button (iOS only) |
MaterialDatePicker and MaterialTimePicker from Google's Material Components.UIDatePicker inside a UIAlertController.
UIDatePickerStyleWheels.UIDatePickerStyleWheels.UIAlertController with a segmented control and UIDatePickerStyleInline for a smooth sequential selection.Apache License 2.0. See LICENSE for details.
A Kotlin Multiplatform library that provides a truly native Date and Time Picker experience for both Android and iOS. This library uses platform-specific components that automatically inherit your application's theme and branding.
MaterialDatePicker/MaterialTimePicker on Android and Apple's UIDatePicker on iOS.suspend functions that return selected values or null if cancelled.rememberDatePicker() and rememberTimePicker() helpers for seamless integration.| Android | iOS |
|---|---|
![]() |
![]() |
Add the dependency to your commonMain source set in your build.gradle.kts:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.ktsnippetbyshubham:kmp-native-datepicker:1.0.2")
}
}
}val datePicker = rememberDatePicker()
val scope = rememberCoroutineScope()
Button(onClick = {
scope.launch {
val selectedMillis = datePicker.pickDate(
title = "Select Birthday"
)
if (selectedMillis != null) {
// Handle selected date
}
}
}) {
Text("Open Date Picker")
}val timePicker = rememberTimePicker()
Button(onClick = {
scope.launch {
val time = timePicker.pickTime(
title = "Select Time",
is24Hour = true
)
if (time != null) {
println("Selected: ${time.hour}:${time.minute}")
}
}
}) {
Text("Open Time Picker")
}Button(onClick = {
scope.launch {
val range = datePicker.pickDateRange(
title = "Select Vacation Dates"
)
if (range != null) {
println("Range: ${range.startDateMillis} - ${range.endDateMillis}")
}
}
}) {
Text("Open Range Picker")
}If you are not using Compose:
val datePicker = DatePickerFactory(context).createDatePicker()val timePicker = TimePickerFactory(context).createTimePicker()val datePicker = DatePickerFactory().createDatePicker()val timePicker = TimePickerFactory().createTimePicker()The library is designed to be "Brand-Aware". You don't need to pass color codes manually.
The pickers follow your MaterialTheme. To change the color, simply update your colorPrimary in your app's theme:
<item name="colorPrimary">#FF5722</item> <!-- Your brand color -->The pickers automatically use the System Global Tint. If you have set a custom tint color for your app's window, the picker buttons and selection highlights will match it automatically.
| Parameter | Type | Description |
|---|---|---|
initialDateMillis |
Long? |
Initial date to show (Default: Now) |
minDateMillis |
Long? |
Minimum selectable date |
maxDateMillis |
Long? |
Maximum selectable date |
title |
String? |
Custom title for the dialog |
doneButtonText |
String? |
Custom label for Done button (iOS only) |
cancelButtonText |
String? |
Custom label for Cancel button (iOS only) |
| Parameter | Type | Description |
|---|---|---|
initialHour |
Int? |
Initial hour (0-23) |
initialMinute |
Int? |
Initial minute (0-59) |
is24Hour |
Boolean |
Whether to use 24-hour format |
title |
String? |
Custom title for the dialog |
doneButtonText |
String? |
Custom label for Done button (iOS only) |
cancelButtonText |
String? |
Custom label for Cancel button (iOS only) |
MaterialDatePicker and MaterialTimePicker from Google's Material Components.UIDatePicker inside a UIAlertController.
UIDatePickerStyleWheels.UIDatePickerStyleWheels.UIAlertController with a segmented control and UIDatePickerStyleInline for a smooth sequential selection.Apache License 2.0. See LICENSE for details.