npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-xflex-datepicker

v2.0.4

Published

React datepicker component

Readme

React XFLEX Date Picker

A very simple react datepicker component which includes range picker. Now supports server side rendering.

Installation

The package can be installed via NPM:

npm install react-xflex-datepicker --save

Or yarn:

yarn add react-xflex-datepicker

Usage

  1. Datepicker component for choosing only one date:
import { XFlexDatepicker } from 'react-xflex-datepicker';
  1. Daterange picker component:
import { XFlexDatepickerRange } from 'react-xflex-datepicker';

Then you can use it in your code:

<XFlexDatepicker />

or

<XFlexDatepickerRange />

Styles need to be imported separately.

import 'react-xflex-datepicker/dist/xflex-datepicker.css';

Options

Datepicker

moment is required for some of the options

| Option | Type | Values | Default | Description | | :--------------------- | :------------------------------------------------------------------------------------------------------------ | :----------------- | :----------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------- | | initialDate | Moment | moment dates, null | moment() (Current date) | This is the initial date set on the calendar on mount. | | position | String | top, bottom | bottom | It tells where the calendar will be positioned regarding the input control. This property has no effect when inputControl is set to false. | | inputControl | Boolean | true, false | true | When is set to false, the calendar will be visible all the time, otherwise it will be opened by a button. | | placeholder | String | any | Choose date... | This is the placeholder on the input control when no date is selected. It has no effect when inputControl is set to false. | | String | moment formats (see momentjs webpage for available formats) | YYYY, MMMM DD | The format in which the dates will be shown on the input control. Has no effect when inputControl is set to false. | | locale | String | moment locale | en | The locale of the calendar. This does not affect the placeholder | | buttonControlClassName | String | any className | '' | This is optional className for the button control for custom styling. |

Datepicker Range

Range datepicker has the same above options as the datepicker and a few more:

| Option | Type | Values | Default | Description | | :----------- | :------- | :---------- | :-------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------ | | hasTooltip | Boolean | true, false | true | Whether or not to have an info tooltip on day mouseover | | tooltipLabel | Function | functions | (numberOfNights) => {return numberOfNights} | Provided this function, you can set a custom label for the day tooltip. It receives number of nights between the days selected. |

Events

| Event | Arguments | Description | | :------------- | :------------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | onChooseDate | date: Moment object | Fired when clicked on a date. On datepicker it fires with {date: Moment} and on range picker with {start: Moment, end: Moment \| null. The end date is null if the event is fired when selecting the start date. | | onClearDate | date: Moment object | Fired when cleared a date from the input control. On datepicker it fires with {date: Moment} and on range picker with {start: Moment, end: Moment \| null. The object tells which dates have been cleared. The end date is null if the event is fired when only the start date is selected. | | onCalendarShow | none | Fired when the calendar is shown. Only when inputControl is false | | onCalendarHide | none | Fired when the calendar is hidden. Only when inputControl is false | | onMonthDayOver | date: Moment object | Fired when mouseover on a date. The argument is a Moment object which represents the date that has been hovered. |

License

ISC