🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-lava-lamp-menu

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-lava-lamp-menu

A gooey menu component

1.0.1
latest
Source
npm
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

react-lava-lamp-menu

A menu component with a lava lamp effect when selecting a menu option.

NPM JavaScript Style Guide

Demo

https://jbccollins.github.io/react-lava-lamp-menu/

Install

npm install --save react-lava-lamp-menu

Usage

import React, { Component } from 'react'

import LavaLampMenu from 'react-lava-lamp-menu'

class Example extends Component {
  
  state = {
  	selectedItemId: "item1"
  }

  handleSelectedItemChange = id => {
  	this.setState({selectedItemId: id});
  }

  render () {
    return (
		<LavaLampMenu
			itemStyle={{color:'red'}}
			mouseOverItemStyle={{color: 'black'}}
			selectedItemStyle={{backgroundColor: 'black', color: 'red'}}
			sliderStyle={{backgroundColor: 'black'}}}
			onSelectedItemChange={this.handleSelectedItemChange}
			items={[
				name: 'Menu Item 1', id: "item1",
				name: 'Menu Item 2', id: "item2",
				name: 'Menu Item 3', id: "item3",
			]}
			selectedItemId={this.state.selectedItemId}/>
    )
  }
}
propdescription
itemsList of menu items
itemStyleInline style for all items
mouseOverItemStyleInline style for the item that is currently being moused over. Will override any conflicting styles from itemStyle
selectedItemStyleInline style for the item that is currently selected. Will override any conflicting styles from itemStyle and mouseOverItemStyle
onSelectedItemChangeReceives the selected item id on click
selectedItemIdThe id of the item that is currently selected

Development

From the top level directory run yarn start

In a separate terminal window, from the example directory run yarn start

License

MIT © jbccollins

FAQs

Package last updated on 08 Nov 2018

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