New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-bootstrap-custom-inputs

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bootstrap-custom-inputs

React compatible inputs adhering to Bootstrap theme.

latest
Source
npmnpm
Version
1.8.15
Version published
Weekly downloads
1
-93.33%
Maintainers
1
Weekly downloads
 
Created
Source

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:

NameRequiredDescriptionDefault
onChangetruehandler function-
nametruestring representing State property-
listtruearray 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-
labelfalsestring to enable interaction with the input through it's label-
valuefalsestring or string[] matching key property of list objects-
classNamefalsestring consisting of classes to apply to the input-
languagefalsestring currently supported values [en, lv]'en'
debouncefalsenumber representing debounce in milliseconds500ms
autoCompletefalse'on' or 'off''off'
multiselectfalsebool to enable the ability of selecting multiple itemsfalse
multiselectPreviewfalsenumber to display values if selected count is equal or less, 'default' to display 'Selected #', 'value' to always display value'default'
validfalsebool to override default required with your own definition (i.e. valid === true when at least 3 items are selected)-
requiredfalsebool to enable Bootstrap is-valid/is-invalid validationsfalse
disableDeselectfalsebool === true disables ability to deselect when multiselect === falsefalse
disabledfalseboolfalse

 

DatePicker Props:

NameRequiredDescriptionDefault
onChangetruehandler function-
nametruestring representing State property-
labelfalsestring to enable interaction with the input through it's label-
valuefalsestring or string[] in RFC2822 or ISO format'DD.MM.YYYY'
classNamefalsestring consisting of classes to apply to the input-
languagefalsestring currently supported values [en, lv]'en'
highlightDatefalsestring in RFC2822 or ISO format''
highlightColorfalsestring describing color in hexadecimal''
asIconfalsebool to render an icon depicting a calendar instead of text inputfalse
alignmentfalsestring controlling expanded calendar alignment [left, right]'left'
multiselectfalseboolfalse
validfalsebool-
requiredfalseboolfalse
disabledfalseboolfalse
disableDeselectfalsebool === true disables ability to deselect when multiselect === falsefalse

 

TimePicker Props:

NameRequiredDescriptionDefault
onChangetruehandler function-
nametruestring representing State property-
labelfalsestring to enable interaction with the input through it's label-
valuefalsestring in the format HH:mm'--:--'
classNamefalsestring-
validfalsebool-
requiredfalseboolfalse
disabledfalseboolfalse
disableDeselectfalsebool === true disables ability to deselect when multiselect === falsefalse

 

TextInput Props:

NameRequiredDescriptionDefault
onChangetruehandler function-
nametruestring representing State property-
labelfalsestring to enable interaction with the input through it's label-
valuefalsestring''
debouncefalsenumber representing debounce in milliseconds500ms
classNamefalsestring-
validfalsebool-
requiredfalseboolfalse
disabledfalseboolfalse

Keywords

react

FAQs

Package last updated on 30 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts