0.1.10 • Published 3 years ago

react-bulma-dropdown v0.1.10

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

React Bulma dropdown

It's a Bulma's dropdown, with an auto-height, scroll and portal support.

The .dropdown-menu is not simply rendered below the .dropdown-trigger, but is portaled to another DOM element. Thanks to that your dropdown will work in element that has overflow:hiden or overflow:scroll CSS style.

The .dropdown-menu is auto resizing to match the portal's bottom edge.

Installation

yarn add react-bulma-dropdown

You have also to include the dist/main.css file.

Basic example

import Dropdown from 'react-bulma-dropdown'

<Dropdown trigger="Choose">
  <a href="#" className="dropdown-item">Item A</a>
  <a href="#" className="dropdown-item">Item B</a>
  <a href="#" className="dropdown-item">Item C</a>
</Dropdown>

You can find more examples in Storybook.

Properties

PropertyTypeDescriptionDefault
childrenReactNodeThe .dropdown-content's content
triggerstring or ReactNodeThe trigger rendered in the .dropdown-trigger"Open dropdown"
portalnull or HTMLElementElement to which the .dropdown-menu will be portaled. If null, then it will be portaled to the end of the documentnull
classNamestringOptional CSS class name for the .dropdown-menu's wrapper""
openOnMountbooleanOpen the .dropdown-menu on mountfalse
isAnimatedbooleanAnimate the .dropdown-menu openingtrue
hideOnLinkClickbooleanClose the .dropdown-menu after clicking an a.dropdown-itemtrue
marginintegerMin. distance between bottom of the dropdown and bottom of the portal20
controlRef(ref: ControlRefType) => voidA ref that consist object with open and close methods.undefined

Development

yarn run storybook
0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago