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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@srph/react-date-select

v0.1.1

Published

Generic `select` elements for dates - year, month, and day.

Downloads

9

Readme

React Date Select npm version Build Status

Generic select elements for dates - year, month, and day.

View demo / View examples

Installation

npm i @srph/react-date-select --save

Script tags

If you're not using a bundler like Browserify or Webpack, simply add the script tag after your React script tag.

<!-- Script tags for React and other libraries -->
<script src="https://unpkg.com/@srph/react-date-select/dist/react-date-select.min.js"></script>

This library is exposed as ReactDateSelect (e.g., ReactDateSelect.YearSelect, ReactDateSelect.MonthSelect, ReactDateSelect.DaySelect).

Usage

import React from 'react';
import {YearSelect, MonthSelect, DaySelect} from '@srph/react-date-select';

class App extends React.Component {
  state = {
    y: 0,
    m: 0,
    d: 0
  }

  render() {
    const {y, m, d} = this.state;

    return (
      <div>
        <YearSelect value={y} onChange={this.handleYearChange} />
        <MonthSelect value={m} onChange={this.handleMonthChange} />
        <DaySelect month={m} value={d} onChange={this.handleDayChange} />
      </div>
    );
  }

  handleYearChange = (value) => {
    this.setState({ y: value });
  }

  handleMonthChange = (value) => {
    this.setState({ m: value });
  }

  handleDayChange = (value) => {
    this.setState({ d: value });
  }
}

Checkout the examples.

API Documentation

Here's a list of props you may use to customize the component for your use-case:

YearSelect

All other props are passed down to the select element as usual.

| Prop | Type | Description | | ----- | ---- | ----------- | | start | number | The starting year. Defaults to 1970 | | end | number | The ending year range. Defaults to new Date().getFullYear() | | placeholder | string | The placeholder text when select has a no value. Defaults to Select year. | | onChange | function | The callback when value changes |

MonthSelect

All other props are passed down to the select element as usual.

| Prop | Type | Description | | ----- | ---- | ----------- | | placeholder | string | The placeholder text when select has a no value. Defaults to Select month. | | onChange | function | The callback when value changes |

DaySelect

All other props are passed down to the select element as usual.

| Prop | Type | Description | | ----- | ---- | ----------- | | year | string | The year to be used as basis for the month. Useful for leap years. Defaults to new Date().getFullYear(). | | month | string (required) | The month to be used as basis for the days | | monthPlaceholder | string | The placeholder text when month is null. Defaults to Select month to proceed. | | placeholder | string | The placeholder text when select has no value. Defaults to Select day. | | onChange | function | The callback when value changes |

Setup

You can check the demo, or build it yourself locally:

npm install
npm run start

Bundling package

npm run bundle

Publish storybook

npm run storybook:publish