A Native Date and Time Picker library for react native which uses Jetpack Compose Material3 Date and Time Pickers under the hood. It uses react Native Fabric Component (New Architecture only)
This package uses React Natiev new architecture's Fabric Component so it'll only work if your app has new architechture enabled in android/gradle.properties file.
npm install react-native-jetpack-compose-datetimepicker
import { MaterialDatetimepicker } from 'react-native-jetpack-compose-datetimepicker';
// ...
<MaterialDatetimepicker
defaultDate={new Date()}
onCancel={() => console.log('cancel')}
isVisible={true} //true|false -> manage with useState
onConfirm={(val) => console.log(val)} // val is Date object
confirmText="Confirm"
displayMode="picker" // picker | input
pickerType="date" // date | time
themeVarient="dark" // light | dark | system ->(default value is system means it follows system setting)
dynamicColors={false} // true | false (default is true)
/>;
- Date Picker/ Time Picker
- Inout Mode and Picker Mode
- Light and Dark Theme based support
- Dynamic Theme support based on wallpaper colors (Material You)
- Props autocompletion (Typescript)
Check example folder for demo code. You can run the demo using this command
yarn example
OR
npm run example
video_20240731_122631_edit.mp4
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library