react-responsive-select-pkdcryptos1
TypeScript icon, indicating that this package has built-in type declarations

5.1.1 • Public • Published

react-responsive-select

Build status

A customisable, touchable, React single-select / multi-select form control.

Built with keyboard and screen reader accessibility in mind.

Features

  • Single and Multi select modes
  • Accessible WAI ARIA compliance
  • Touch friendly
  • Keyboard friendly
  • Similar interaction experience across platforms
  • Custom label rendering
  • Custom option markup
  • Option headers
  • Mimics keyboard functionality where possible (sans multiselect)
  • Easy slot-in to your design system
  • No global styling

Getting started

Install the dependency - https://www.npmjs.com/package/react-responsive-select

npm install react-responsive-select -save-dev

Example usage:

import React from 'react';
import RRS from 'react-responsive-select';
 
const onChange = (newValue) => console.log('onChange', newValue);
const onSubmit = () => console.log('onSubmit');
 
const Form = () => (
  <form>
    <RRS
      name="make"
      options={[
        { text: 'Any', value: 'null' },
        { text: 'Oldsmobile', value: 'oldsmobile', markup: <span>Oldsmobile</span> },
        { text: 'Ford', value: 'ford', markup: <span>Ford</span> }
      ]}
      selectedValue="oldsmobile"
      onSubmit={onSubmit}
      onChange={onChange}
      caretIcon={<CaretIcon />}
    />
  </form>
);

StoryBook Examples & Demo

https://benbowes.github.io/react-responsive-select/

API

https://benbowes.github.io/react-responsive-select/?path=/story/info--api

Screen Reader Demo

https://benbowes.github.io/react-responsive-select/?path=/story/info--screen-reader-demo

CodeSandbox.io JavaScript Examples

TypeScript Examples

Via CDN

The Codepen examples are consuming react-responsive-select via CDN if you'd like a guide.

Business Rules

Have a read of README_BUSINESS_RULES.md

Package Sidebar

Install

npm i react-responsive-select-pkdcryptos1

Weekly Downloads

3

Version

5.1.1

License

MIT

Unpacked Size

684 kB

Total Files

322

Last publish

Collaborators

  • pkdcryptos