@igloo-ui/dropdown
TypeScript icon, indicating that this package has built-in type declarations

1.8.1 • Public • Published

Dropdown

Displays a sub-element overlaid and renders the content

Installation

To install @igloo-ui/dropdown in your project, you will need to run the following command using npm:

npm install @igloo-ui/dropdown

If you prefer Yarn, use the following command instead:

yarn add @igloo-ui/dropdown

Usage

Then to use the component in your code just import it!

import Dropdown from '@igloo-ui/dropdown';
import Button from '@igloo-ui/button';

const [show, setShow] = React.useState(false);

function List() {
  const listItem = items.map((item, key) => (
    <li key={`list-item_${key}`}>{item}</li>
  ));
  return <ul>{listItem}</ul>;
}

<Dropdown isOpen={show} onClose={() => setShow(false)} content={<List />}>
  <Button appearance="secondary" size="small" onClick={() => setShow(!show)}>
    Settings
  </Button>
</Dropdown>;

Readme

Keywords

none

Package Sidebar

Install

npm i @igloo-ui/dropdown

Weekly Downloads

229

Version

1.8.1

License

Apache-2.0

Unpacked Size

1.35 MB

Total Files

8

Last publish

Collaborators

  • infra.admin
  • franckgaudin