@headless-react/menu
TypeScript icon, indicating that this package has built-in type declarations

0.0.16 • Public • Published

@headless-react/menu

Headless React Menu component with @react-aria and @react-stately.

Getting Started

$ npm install @headless-react/menu
import { Menu } from '@headless-react/menu'

const AutoComplete = ({
  label,
  items
}) => {
  return (
    <ComboBox defaultItems={items}>
      <ComboBox.Label>{label}</ComboBox.Label>
      <ComboBox.InputGroup>
        {({ selectedItem }) => (
          <>
            <ComboBox.Input />
            <ComboBox.PopoverTrigger />
          </>
        )}
      </ComboBox.InputGroup>
      <ComboBox.Popover>
        <ComboBox.Options>
          {({ options }) => options.map(option => (
            <ComboBox.Option key={option.key} option={option}>
              {option.name}
            </ComboBox.Option>
          ))}
        </ComboBox.Options>
      </ComboBox.Popover>
    </ComboBox>
  )
}

Example

CodeSandBox Example

Package Sidebar

Install

npm i @headless-react/menu

Weekly Downloads

3

Version

0.0.16

License

Apache-2.0

Unpacked Size

883 kB

Total Files

21

Last publish

Collaborators

  • so99ynoodles