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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-bootstrap-custom-inputs

v1.8.15

Published

React compatible inputs adhering to Bootstrap theme.

Downloads

19

Readme

React Bootstrap Custom Inputs

A library providing great looking input elements for projects using React with Bootstrap.

Interactive sandbox(Storybook) to test out the components

react-bci.vercel.app

Usage examples:

With Hooks

import { useState } from 'react';
import DatePicker from 'react-bootstrap-custom-inputs';

function App() {
  const [date, setDate] = useState('2021-01-31');

  const handleDate = useCallback(({ target: { value } }) => setDate(value), []);

  return (
    <div className="container-fluid vh-100">
      <div className="row h-75 justify-content-center align-items-center">
        <DatePicker
          onChange={handleDate}
          value={date}
          label="Date"
          required
          className="col-4"
        />
      </div>
    </div>
  );
}

export default App;

With Classes

import React, { Component } from 'react';
import { DatePicker } from 'react-bootstrap-custom-inputs';

class App extends Component {
  constructor(props) {
    super(props);

    this.state = {
      date: '2021-01-31',
    };

    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(e) {
    const { name, value } = e.target;

    this.setState({
      [name]: value,
    });
  }

  render() {
    const { date } = this.state;

    return (
      <div className="container-fluid vh-100">
        <div className="row h-75 justify-content-center align-items-center">
          <DatePicker
            onChange={this.handleChange}
            value={date}
            name="date"
            label="Date"
            required
            className="col-4"
          />
        </div>
      </div>
    );
  }
}

export default App;

Autocomplete Props:

| Name | Required | Description | Default | | ---- | -------- | ----------- | ------- | | onChange | true | handler function | - | | name | true | string representing State property | - | | list | true | array of objects with key(unique string), value(string), title(optional string), isImportant(optional boolean) to display a star icon, isBackground(optional boolean) to hide on open, children(support for nested list of the same format) properties | - | | label | false | string to enable interaction with the input through it's label | - | | value | false | string or string[] matching key property of list objects | - | | className | false | string consisting of classes to apply to the input| - | | language | false | string currently supported values [en, lv] | 'en' | | debounce | false | number representing debounce in milliseconds | 500ms | | autoComplete | false | 'on' or 'off' | 'off' | | multiselect | false | bool to enable the ability of selecting multiple items | false | | multiselectPreview | false | number to display values if selected count is equal or less, 'default' to display 'Selected #', 'value' to always display value | 'default' | | valid | false | bool to override default required with your own definition (i.e. valid === true when at least 3 items are selected) | - | | required | false | bool to enable Bootstrap is-valid/is-invalid validations | false | | disableDeselect | false | bool === true disables ability to deselect when multiselect === false | false | | disabled | false | bool | false |

DatePicker Props:

| Name | Required | Description | Default | | ---- | -------- | ----------- | ------- | | onChange | true | handler function | - | | name | true | string representing State property | - | | label | false | string to enable interaction with the input through it's label | - | | value | false | string or string[] in RFC2822 or ISO format | 'DD.MM.YYYY' | | className | false | string consisting of classes to apply to the input| - | | language | false | string currently supported values [en, lv] | 'en' | | highlightDate | false | string in RFC2822 or ISO format | '' | | highlightColor | false | string describing color in hexadecimal | '' | | asIcon | false | bool to render an icon depicting a calendar instead of text input | false | | alignment | false | string controlling expanded calendar alignment [left, right] | 'left' | | multiselect | false | bool | false | | valid | false | bool | - | | required | false | bool | false | | disabled | false | bool | false | | disableDeselect | false | bool === true disables ability to deselect when multiselect === false | false |

TimePicker Props:

| Name | Required | Description | Default | | ---- | -------- | ----------- | ------- | | onChange | true | handler function | - | | name | true | string representing State property | - | | label | false | string to enable interaction with the input through it's label | - | | value | false | string in the format HH:mm | '--:--' | | className | false | string | - | | valid | false | bool | - | | required | false | bool | false | | disabled | false | bool | false | | disableDeselect | false | bool === true disables ability to deselect when multiselect === false | false |

TextInput Props:

| Name | Required | Description | Default | | ---- | -------- | ----------- | ------- | | onChange | true | handler function | - | | name | true | string representing State property | - | | label | false | string to enable interaction with the input through it's label | - | | value | false | string | '' | | debounce | false | number representing debounce in milliseconds | 500ms | | className | false | string | - | | valid | false | bool | - | | required | false | bool | false | | disabled | false | bool | false |