slim-datepicker

Slim input date input with optimized keyboard travel and an optional date picker modal

Usage no npm install needed!

<script type="module">
  import slimDatepicker from 'https://cdn.skypack.dev/slim-datepicker';
</script>

README

slim-datepicker NPM version Downloads All Contributors

Flexible user friendly datepicker with optional calendar.

slim-datepicker

Getting Started

yarn add slim-datepicker

or

npm i slim-datepicker

Usage

Basic use:

import React, { useState } from 'react'
import SlimDatePicker from 'slim-datepicker';

const App = () => {
  return <SlimDatePicker
  min="5"
  max="30"
  onSubmit={date => {
    console.log("Submitted", date);
  }}
  containerStyle="container-class"/>;
}

// Only calendar
const App2 = () => {
  return <SlimDatePicker
  min="5"
  max="30"
  onlyCalendar
  calenderIconHTML={<h1 style={{"color": "#000"}}>Open Calendar</h1>}
  onSubmit={date => {
    console.log("Submitted", date);
  }}
  containerStyle="container-class"/>;
}

defaultDate: PropTypes.object, min: PropTypes.string, max: PropTypes.string, onSubmit: PropTypes.func, calendarIcon: PropTypes.string, containerStyle: PropTypes.string, onlyCalendar: PropTypes.bool, calenderIconHTML: PropTypes.node,

Options

Props Description Default value
defaultDate Default date new Date() // Tue Jul 14 2020 19:11:09 GMT+0530 (India Standard Time)
min min age (Duration) - Example : 5 (Till 5 years from now), IF (-ve) Ex: -10 then date supports till 2025 (Future date) --
max max age (Duration) - Example : 30 (Upto 30 years earlier) --
onSubmit Triggers once date valid & filled / Selected from calendar
calendarIcon Calendar trigger Icon, On click on this calendar modal will open default icon
containerStyle Styling the date picker container default style
calenderIconHTML Just a text or button click can trigger calendar via this --

PREVIEW

slim-datepicker

slim-datepicker

Demo Sandbox

Here DemoSandbox

Releases

Here Releases

Note: For Contributors

This repo build with create-react-library

Contributors

Here Contributors

License

ISC BharatPe TM