compose-datepicker
1.0.3indexedLightweight, customizable Material 3 date picker offering single and range selection, range highlighting, easy theming, and state API exposing selected date, range, and current month.
Lightweight, customizable Material 3 date picker offering single and range selection, range highlighting, easy theming, and state API exposing selected date, range, and current month.
A lightweight, customizable Date Picker for Jetpack Compose and Compose Multiplatform, built with Material 3.
The library is available on Maven Central. Add the repository to your settings.gradle.kts if not already present:
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}
| Sample App | Android | iOS |
|---|---|---|
![]() | ![]() | ![]() |
Add the dependency to your module's build.gradle.kts:
dependencies {
implementation("dev.mikelau:compose-datepicker-android:1.1.0")
}
In your shared module's build.gradle.kts:
kotlin {
sourceSets {
commonMain.dependencies {
implementation("dev.mikelau:compose-datepicker:1.1.0")
}
}
}
libs.versions.toml)[versions]
composeDatePicker = "1.1.0"
[libraries]
compose-datepicker = { group = "dev.mikelau", name = "compose-datepicker", version.ref = "composeDatePicker" }
Then in build.gradle.kts:
commonMain.dependencies {
implementation(libs.compose.datepicker)
}
val state = remember { DatePickerState(selectionMode = DatePickerState.SelectionMode.Single) }
ComposeDatePicker(
state = state,
onConfirm = { confirmedState ->
println("Selected date: ${confirmedState.selectedDate}")
},
onCancel = { /* Handle cancel */ }
)
val state = remember { DatePickerState(selectionMode = DatePickerState.SelectionMode.Range) }
ComposeDatePicker(
state = state,
onConfirm = { confirmedState ->
println("Selected range: ${confirmedState.rangeStart} to ${confirmedState.rangeEnd}")
},
onCancel = { /* Handle cancel */ }
)
The three original color parameters still work exactly as before:
ComposeDatePicker(
primaryColor = Color(0xFF6200EE), // selected day, range start/end, today outline
accentColor = Color(0xFF03DAC6), // confirm / cancel buttons
rangeColor = Color(0xFFBB86FC), // range highlight band
onConfirm = { /* ... */ }
)
Pass colors to customize the calendar background, text, start/end highlights and range highlight alpha. This applies to every ComposeDatePicker usage — inside a Dialog, an anchored Popup dropdown, or inline:
ComposeDatePicker(
state = state,
colors = ComposeDatePickerDefaults.colors(
containerColor = Color(),
monthTitleColor = Color.White,
navigationIconColor = Color.White,
dayOfWeekTextColor = Color(),
dayTextColor = Color(),
todayTextColor = Color.White,
todayOutlineColor = Color(),
inRangeDayTextColor = Color(),
selectedDayTextColor = Color.White,
selectedDayColor = Color(),
rangeStartColor = Color(),
rangeEndColor = Color(),
rangeHighlightColor = Color(),
rangeHighlightAlpha = ,
confirmButtonColor = Color(),
confirmButtonTextColor = Color.White,
cancelButtonColor = Color(),
),
onCancel = { },
onConfirm = { }
)
Every parameter is optional — override only what you need; the rest keep the original look. You can also combine both styles: ComposeDatePickerDefaults.colors(primaryColor = ..., accentColor = ..., rangeColor = ...) seeds the defaults the same way the legacy parameters do.
Migrating: no changes are required. If you don't pass
colors, the picker looks identical to previous versions, andprimaryColor/accentColor/rangeColorkeep working. Whencolorsis passed, it takes precedence over those three parameters.
A scrolling, month-by-month calendar inside a modal bottom sheet. Supports both Single and Range selection via DatePickerState.selectionMode. There is no cancel button — swipe down to dismiss; tap Done to confirm.
var showSheet by remember { mutableStateOf(false) }
if (showSheet) {
ComposeDatePickerBottomSheet(
state = remember { DatePickerState(selectionMode = DatePickerState.SelectionMode.Range) },
confirmText = ,
colors = DatePickerBottomSheetDefaults.colors(
containerColor = Color(),
dayTextColor = Color(),
rangeStartColor = Color(),
rangeEndColor = Color(),
rangeHighlightColor = Color(),
rangeHighlightAlpha = ,
selectedDayColor = Color(),
),
onDismissRequest = { showSheet = },
onConfirm = { state ->
println()
showSheet =
}
)
}
Other options: firstDayOfWeek (default Monday), monthsBefore / monthsAfter, maxHeightFraction, monthTitle and dayOfWeekLabel formatters.
DatePickerState provides access to the current selection:
selectedDate: The currently selected LocalDate (Single mode).rangeStart: The start of the selected range (Range mode).rangeEnd: The end of the selected range (Range mode).currentMonth: The month currently being displayed in the picker.Copyright 2026 Mike Lau
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Surfaced from shared tags and platforms — no rankings paid for.