https://github.com/marcauberer/compose-number-picker
🔢 Jetpack Compose compatible number picker for Android
https://github.com/marcauberer/compose-number-picker
android jetpack-compose kotlin library number picker
Last synced: 12 months ago
JSON representation
🔢 Jetpack Compose compatible number picker for Android
- Host: GitHub
- URL: https://github.com/marcauberer/compose-number-picker
- Owner: marcauberer
- License: mit
- Created: 2021-04-11T00:02:21.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T04:37:27.000Z (about 1 year ago)
- Last Synced: 2025-03-25T07:12:03.984Z (about 1 year ago)
- Topics: android, jetpack-compose, kotlin, library, number, picker
- Language: Kotlin
- Homepage:
- Size: 325 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Compose Number Picker Library for Android
[](https://search.maven.org/search?q=g:%22com.chillibits%22%20AND%20a:%22composenumberpicker%22)


[](https://android-arsenal.com/api?level=21)
[](http://makeapullrequest.com)
Compose Number Picker is a library, which provides a simple to use, lightweight number picker component for Jetpack Compose. It has support for horizontal and vertical orientation.
## Try it
If you want to test the library, please visit the sample app on [Google Play](https://play.google.com/store/apps/details?id=com.chillibits.composenumberpickersample)!
## Screenshots (Android 11)

## Usage
If you haven't Jetpack Compose ready to go in your project, please refer to [this guide](https://developer.android.com/jetpack/compose/setup) to include Jetpack Compose into your project.
Then include ComposeNumberPicker to your project:
```groovy
implementation 'com.chillibits:composenumberpicker:1.1.2'
```
As Compose Number Picker supports horizontal and vertical orientation, it provides two components for use:
- HorizontalNumberPicker [view component](./numberpicker/src/main/java/com/chillibits/composenumberpicker/HorizontalNumberPicker.kt)
- VerticalNumberPicker [view component](./numberpicker/src/main/java/com/chillibits/composenumberpicker/VerticalNumberPicker.kt)
This is like a `HorizontalNumberPicker` would look like in your Compose layout:
```kotlin
HorizontalNumberPicker(
min = 10,
max = 100,
default = 50,
modifier = Modifier.padding(10.dp),
onValueChange = { value ->
Toast.makeText(this@MainActivity, value.toString(), Toast.LENGTH_SHORT).show()
}
)
```
If you need an example, please look into the [code](./app/src/main/java/com/chillibits/composenumberpickersample/MainActivity.kt#L35) of the demo app.
## Supported languages
Here are the currently supported languages for the demo app. The library itself is language independent.
- English
- German
- French
New translations are highly appreciated. If you want to translate the lib, please open a pr.
## Contribute to the project
If you want to contribute to this project, please feel free to send us a pull request.
## Credits
Thanks to all contributors and translators!
© Marc Auberer 2021