Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreaslill/composedatepicker
A simple material3 date picker library for jetpack compose.
https://github.com/andreaslill/composedatepicker
android datepicker jetpack-compose
Last synced: 28 days ago
JSON representation
A simple material3 date picker library for jetpack compose.
- Host: GitHub
- URL: https://github.com/andreaslill/composedatepicker
- Owner: AndreasLill
- License: apache-2.0
- Created: 2022-11-27T18:10:38.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-25T14:57:20.000Z (almost 2 years ago)
- Last Synced: 2023-03-01T19:31:26.062Z (almost 2 years ago)
- Topics: android, datepicker, jetpack-compose
- Language: Kotlin
- Homepage:
- Size: 162 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Compose Date Picker
A simple light-weight and customizable `material3` date picker library for jetpack compose.As of jetpack compose material3 version 1.1.0, a date picker does not yet exist.
This libary aims to add it until the official material date picker is released by google.# Instructions
The library is published to the [jitpack.io](http://jitpack.io "jitpack.io") repository.
To use this library you must add jitpack to your project gradle repositories.```gradle
repositories {
maven { url 'https://jitpack.io' }
}
```
Then add the library to dependencies.```gradle
dependencies {
implementation 'com.github.AndreasLill:ComposeDatePicker:1.0.6'
}
```[![](https://jitpack.io/v/AndreasLill/ComposeDatePicker.svg)](https://jitpack.io/#AndreasLill/ComposeDatePicker)
# Usage
Using the date picker is easy and can be further customized to suit your needs.
```kotlin
val dialogState = remember { mutableStateOf(false) }
val date = remember { mutableStateOf(LocalDate.now()) }DatePickerDialog(
state = dialogState,
onSelectDate = {
date.value = it
}
)Button(onClick = { dialogState.value = true }) {
Text("Pick a date")
}
```