You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-pretty-dropdown

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pretty-dropdown

Customizable dropdown menu for React.

1.0.8
latest
Source
npmnpm
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

React Pretty Dropdown

Customizable dropdown menu for React.

Screenshot

Installation

npm install react-pretty-dropdown

Usage

Import the component and set menu items using anchor tags, Link from react-router-dom, or buttons. It doesn't matter the element you use because they'll have the same style.

import Dropdown from 'react-pretty-dropdown';

<Dropdown icon="ellipsis-vertical">
<a href="#">Item 1</a>
<a href="#">Item 2</a>
<a href="#">Item 3</a>
</Dropdown>

Props

background - Background color.
textColor - Text color.
fontSize - Font size.
hoverBackground - Background color on hover.
hoverFontColor - Font color on hover.
activeBackground - Background color of active items.
activeFontColor - Font color of active items.
icon - Menu button icon. Available options: "ellipsis-vertical", "ellipsis", "bars", and "caret-down".
iconSize - Menu icon size.
buttonWidth - Menu button width.
buttonBorderOnHover - Menu button border on hover. Example: "1px solid #0054a8".
buttonBorderOnFocus - Menu button border on focus. Example: "1px solid #0054a8".
buttonFloat - Only used to align the menu button to the right. Set it to "float-end".
menuPosition - Menu horizontal position. The default value is "35px", which leaves no gap between the menu button and items.
width - Width of the whole component.

<Dropdown
icon="ellipsis-vertical"
background="lightblue"
textColor="black"
fontSize="1.5rem"
iconSize="1.7rem"
hoverBackground="green"
hoverFontColor="white"
activeBackground="green"
activeFontColor="white"
width="200px"
buttonFloat="float-end"
>
<a href="#">Item 1</a>
<a href="#">Item 2</a>
<a href="#">Item 3</a>
</Dropdown>

Keywords

React

FAQs

Package last updated on 06 May 2023

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