Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-dropdown-button

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dropdown-button

A carefully crafted drop-down button for React

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45
increased by136.84%
Maintainers
1
Weekly downloads
 
Created
Source

react-dropdown-button

A carefully crafted drop-down button for React

See drop-down demo.

Install

$ npm install react-dropdown-button --save

Description

The drop-down button uses two other React components:

Changelog

See Changelog

Usage


var DDButton = require('react-dropdown-button')

var saveItems = [
	{
		label: 'PDF'
	},
	'-', // a separator
	{
		label: '.DOCX'
	},
	{
		label: 'ODF',
		onClick: function(){
			console.log('save as ODF')
		}
	}
]

function onClick(event, itemProps){
	console.log('You clicked: ' + itemProps.data.label +
	 ' at index ' + itemProps.index)
}

<DDButton items={saveItems} onChildClick={onClick}>
	Save as
</DDButton>

Also see zippyui/react-button

Props

You have the same props as for the react-button, so see docs. Besides the button specific props, you can specify the items prop as an array of objects to be passed to the menu component.

  • items: Array - an array of menu items for the menu of this drop-down button
  • menuProps: Object - props to be passed to the menu component
  • menu: ReactElement - instead of menuProps, you can directly pass in a menu instance

Contributing

$ npm install
$ npm run dev # to start webpack-dev-server
$ npm run serve # to start http-server on port 9091

now navigate to localhost:9091

License

MIT

Keywords

FAQs

Package last updated on 31 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc