0.5.0 • Published 3 years ago

@bsonntag/react-listbox v0.5.0

Weekly downloads
9
License
MIT
Repository
github
Last release
3 years ago

react-listbox

CircleCI build

A customizable, accessible and controllable listbox component for React.

Installation

Using npm:

npm install @bsonntag/react-listbox

Using yarn:

yarn add @bsonntag/react-listbox

Usage

import React from 'react';
import {
  Listbox,
  ListboxButton,
  ListboxButtonLabel,
  ListboxList,
  ListboxOption,
} from '@bsonntag/react-listbox';

function Select() {
  const [value, setValue] = useState();
  return (
    <Listbox value={value} onChange={setValue}>
      <ListboxButton aria-label='Fruit'>
        <ListboxButtonLabel />
      </ListboxButton>
      <ListboxList>
        <ListboxOption>Choose one fruit</ListboxOption>
        <ListboxOption value='apple'>Apple</ListboxOption>
        <ListboxOption value='banana'>Banana</ListboxOption>
        <ListboxOption value='orange'>Orange</ListboxOption>
      </ListboxList>
    </Listbox>
  );
}

Contributing

Please feel free to submit any issues or pull requests.

License

MIT

0.5.0

3 years ago

0.3.2

4 years ago

0.4.0

4 years ago

0.3.3

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago