All Projects → VovanR → react-multiselect-two-sides

VovanR / react-multiselect-two-sides

Licence: MIT license
React multiselect two sides component

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-multiselect-two-sides

best-of-react
🏆 A ranked list of awesome React open-source libraries and tools. Updated weekly.
Stars: ✭ 364 (+2326.67%)
Mutual labels:  react-component
react-grid
react grid component
Stars: ✭ 17 (+13.33%)
Mutual labels:  react-component
react-tags-input
[Not Actively Maintained] An input control that handles tags interaction with copy-paste and custom type support.
Stars: ✭ 26 (+73.33%)
Mutual labels:  react-component
react-native-tabbar
A tabbar component for React Native
Stars: ✭ 59 (+293.33%)
Mutual labels:  react-component
react-mason
React Masonry grid
Stars: ✭ 13 (-13.33%)
Mutual labels:  react-component
react-dates
An easily internationalizable, mobile-friendly datepicker library for the web
Stars: ✭ 12,032 (+80113.33%)
Mutual labels:  react-component
insect
🛠 Highly customisable, minimalistic input x select field for React.
Stars: ✭ 33 (+120%)
Mutual labels:  react-component
react-native-slider-intro
A simple and fully customizable React Native component that implements an intro slider for your app
Stars: ✭ 80 (+433.33%)
Mutual labels:  react-component
react-scroll-trigger
📜 React component that monitors scroll events to trigger callbacks when it enters, exits and progresses through the viewport. All callback include the progress and velocity of the scrolling, in the event you want to manipulate stuff based on those values.
Stars: ✭ 126 (+740%)
Mutual labels:  react-component
react-textarea-code-editor
A simple code editor with syntax highlighting.
Stars: ✭ 247 (+1546.67%)
Mutual labels:  react-component
Registration-and-Login-using-MERN-stack
Simple Registration and Login component with MERN stack
Stars: ✭ 210 (+1300%)
Mutual labels:  react-component
React-Express-JWT-UserPortal
React.js & Express.js User portal Using Core UI, JWT, JWT Token, Refresh Token, Role & Permission management, User manamgenet, Event Log.
Stars: ✭ 22 (+46.67%)
Mutual labels:  react-component
react-ratings-declarative
A customizable rating component for selecting x widgets or visualizing x widgets
Stars: ✭ 41 (+173.33%)
Mutual labels:  react-component
picker
📅 All Date Pickers you need.
Stars: ✭ 185 (+1133.33%)
Mutual labels:  react-component
react-ignore-rerender
🚀 Simple component for ignoring the re-rendering of a piece of React's render method.
Stars: ✭ 28 (+86.67%)
Mutual labels:  react-component
shared-react-components-example
An example of a mono-repository of shared React components libraries!
Stars: ✭ 85 (+466.67%)
Mutual labels:  react-component
react-timer-wrapper
Composable React Timer component that passes status props to children, in addition to some basic callbacks. Can be used at a countdown timer ⏲ or as stopwatch ⏱ to track time while active.
Stars: ✭ 14 (-6.67%)
Mutual labels:  react-component
react-scale-text
A React library to keep an element's text scaled to fit it's container
Stars: ✭ 39 (+160%)
Mutual labels:  react-component
react-file-input
⚛️  A file Input, with drag'n'drop and image editor for React
Stars: ✭ 71 (+373.33%)
Mutual labels:  react-component
git-issue-react-electronjs
⚙️. ⚛️. A desktop application created with Electronjs and Reactjs to be cross-platform to manage and track GitHub issues.
Stars: ✭ 21 (+40%)
Mutual labels:  react-component

react-multiselect-two-sides

Commitizen friendly XO code style

NPM version Build Status Dependency Status DevDependency Status

React multiselect two sides component

Demo: vovanr.github.io/react-multiselect-two-sides

Install

npm install --save react-multiselect-two-sides

Usage

See: example

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

    this.state = {
      options: [
        {name: 'Foo', value: 0},
        {name: 'Bar', value: 1},
        {name: 'Baz', value: 2, disabled: true},
        {name: 'Qux', value: 3},
        {name: 'Quux', value: 4},
        {name: 'Corge', value: 5},
        {name: 'Grault', value: 6},
        {name: 'Garply', value: 7},
        {name: 'Waldo', value: 8},
        {name: 'Fred', value: 9},
        {name: 'Plugh', value: 10},
        {name: 'Xyzzy', value: 11},
        {name: 'Thud', value: 12}
      ],
      value: [0, 3, 9]
    };
  },

  handleChange = (value) => {
    this.setState({value});
  }

  render() {
    const {options, value} = this.state;
    const selectedCount = value.length;
    const availableCount = options.length - selectedCount;

    return (
      <MultiselectTwoSides
        {...this.state}
        className="msts_theme_example"
        onChange={this.handleChange}
        availableHeader="Available"
        availableFooter={`Available: ${availableCount}`}
        selectedHeader="Selected"
        selectedFooter={`Selected: ${selectedCount}`}
        labelKey="name"
        showControls
        searchable
      />
    );
  }
}

ReactDOM.render(<App/>, document.getElementById('app'));

Api

MultiselectTwoSides.propTypes = {
  availableFooter: PropTypes.node,
  availableHeader: PropTypes.node,
  className: PropTypes.string,
  clearFilterText: PropTypes.string,
  clearable: PropTypes.bool,
  deselectAllText: PropTypes.string,
  disabled: PropTypes.bool,
  filterBy: PropTypes.func,
  filterComponent: PropTypes.func,
  highlight: PropTypes.array,
  labelKey: PropTypes.string,
  limit: PropTypes.number,
  onChange: PropTypes.func,
  options: PropTypes.array,
  placeholder: PropTypes.string,
  searchable: PropTypes.bool,
  selectAllText: PropTypes.string,
  selectedFooter: PropTypes.node,
  selectedHeader: PropTypes.node,
  showControls: PropTypes.bool,
  value: PropTypes.array,
  valueKey: PropTypes.string
};

MultiselectTwoSides.defaultProps = {
  availableFooter: null,
  availableHeader: null,
  className: null,
  clearFilterText: 'Clear',
  clearable: true,
  deselectAllText: 'Deselect all',
  disabled: false,
  // Case-insensitive filter
  filterBy: (option, filter, labelKey) => option[labelKey].toLowerCase().indexOf(filter.toLowerCase()) > -1,
  filterComponent: null,
  highlight: [],
  labelKey: 'label',
  limit: undefined,
  onChange: () => {},
  options: [],
  placeholder: '',
  searchable: false,
  selectAllText: 'Select all',
  selectedFooter: null,
  selectedHeader: null,
  showControls: false,
  value: [],
  valueKey: 'value'
};

License

MIT © Vladimir Rodkin

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].