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

lliure-birthday-picker

v1.0.1

Published

iOS-style wheel picker for birthday selection (month/day)

Downloads

198

Readme

Birthday Picker

iOS-style wheel picker for birthday selection (month/day only, without year).

Demo

Features

  • iOS-style infinite scroll wheels
  • Automatic localization (month names, day/month order via Intl API)
  • Bootstrap 5 integration (sizes, input-groups, validation states)
  • RTL support
  • Auto-positioning (dropup when near bottom)
  • Touch and mouse support
  • HTML5 validation (required attribute)
  • Clear button support
  • Full API (getValue, setValue, open, close, clear)
  • Events (input, change, birthday-picker:change)

Installation

CDN (jsDelivr)

<link rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/[email protected]/dist/birthday-picker.min.css"
      integrity="sha384-NDF7NYI9/arsBYaRjIBRhLmU1n0knWxL6vBmz35yP8YwTZWujBznRiAhgfHxjVBK"
      crossorigin="anonymous">

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/birthday-picker.min.js"
        integrity="sha384-3Bpe+TqozFzn7Qkw5X+P5GkdPqAvmC2+F85xdDWyLF+GOIyAmbJh6NW2kN3eTQ+I"
        crossorigin="anonymous"></script>

CDN (unpkg)

<link rel="stylesheet"
      href="https://unpkg.com/[email protected]/dist/birthday-picker.min.css"
      integrity="sha384-NDF7NYI9/arsBYaRjIBRhLmU1n0knWxL6vBmz35yP8YwTZWujBznRiAhgfHxjVBK"
      crossorigin="anonymous">

<script src="https://unpkg.com/[email protected]/dist/birthday-picker.min.js"
        integrity="sha384-3Bpe+TqozFzn7Qkw5X+P5GkdPqAvmC2+F85xdDWyLF+GOIyAmbJh6NW2kN3eTQ+I"
        crossorigin="anonymous"></script>

NPM

npm install lliure-birthday-picker
import 'lliure-birthday-picker/src/birthday-picker.css';
import 'lliure-birthday-picker/src/birthday-picker.js';

Manual

Download birthday-picker.js and birthday-picker.css from the src/ folder.

Usage

Auto-initialization

Add class birthday-picker to any input:

<input type="text" class="form-control birthday-picker" value="03-15">

The picker initializes automatically on DOMContentLoaded.

Manual initialization

// By selector
BirthdayPicker.init('.my-picker');

// By element
BirthdayPicker.init(document.getElementById('myInput'));

// With options
BirthdayPicker.init('.my-picker', {
    onChange: function(data) {
        console.log(data.value);     // "03-15"
        console.log(data.month);     // 2 (0-indexed)
        console.log(data.day);       // 15
        console.log(data.formatted); // "March 15" or "15 de marzo"
    }
});

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | onChange | Function | null | Callback when value changes | | locale | String | auto | Locale for month names (e.g., 'pt-BR', 'es-MX') |

Data Attributes

| Attribute | Values | Description | |-----------|--------|-------------| | data-position | start, center, end | Dropdown alignment | | data-allow-clear | true, false | Show clear button (default: true if not required) | | dir | rtl | Enable right-to-left mode | | disabled | - | Disable the picker | | required | - | Make field required (hides clear button) |

API

Get the picker instance:

const picker = BirthdayPicker.getInstance(inputElement);
// or
const picker = inputElement._birthdayPicker;

Methods

picker.getValue();        // Returns "MM-DD" or null
picker.setValue('03-15'); // Set value
picker.clear();           // Clear value
picker.open();            // Open dropdown
picker.close();           // Close dropdown
picker.destroy();         // Remove picker

Events

Native events

// 'input' and 'change' events fire on the original input
input.addEventListener('change', (e) => {
    console.log(e.target.value); // "03-15"
});

Custom event

// 'birthday-picker:change' fires on the container with more details
container.addEventListener('birthday-picker:change', (e) => {
    console.log(e.detail.value);     // "03-15"
    console.log(e.detail.month);     // 2 (0-indexed)
    console.log(e.detail.day);       // 15
    console.log(e.detail.formatted); // "March 15"
});

Bootstrap Integration

Works seamlessly with Bootstrap 5:

<!-- Sizes -->
<input class="form-control form-control-sm birthday-picker">
<input class="form-control birthday-picker">
<input class="form-control form-control-lg birthday-picker">

<!-- Input groups -->
<div class="input-group">
    <span class="input-group-text"><i class="fas fa-gift"></i></span>
    <input class="form-control birthday-picker">
</div>

<!-- Validation states -->
<input class="form-control birthday-picker is-valid">
<input class="form-control birthday-picker is-invalid">

Value Format

The picker uses MM-DD format (zero-padded):

  • 01-15 = January 15
  • 03-25 = March 25
  • 12-31 = December 31

Browser Support

  • Chrome, Firefox, Safari, Edge (modern versions)
  • iOS Safari, Android Chrome
  • Requires ES6+ support

License

MIT