1.1.0 • Published 2 years ago

react-dropdown-animated v1.1.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

react-dropdown-animated

A customizable dropdown menu button with simple animations for React. For those who like a little animation on your React app for some pizzaz.

Alt Text

Installation

npm install react-dropdown-animated

Usage

Default styling of the component can be overridden. Component can be imported using

import Dropdown from "react-dropdown-animated"

Props

The dropdown button takes the following props:

PropTypeDescriptionDefault value
valuestringThe value of the button text.Dropdown button
optionsobject[]An array of objects containing the content and the callback function when the option is clicked.options=[{content: 'Default Option 1', onClick: (event) => console.log('Option 1 clicked!')}, {content: 'Default Option 2', onClick: (event) => {console.log('Option 2 clicked!')}}]
initialnumberThe percentage value of the initial y position of the button. A higher value indicates the button moves in faster from a higher position.50
exitnumberThe percentage value of the exit y position of the button. A higher value indicates the button moves out faster to a higher position.25
buttonFontColorstringThe hex code of the button font color.#ffffff
buttonBackgroundColorstringThe hex code of the button background color.#227fe3
buttonOutlineColorstringThe hex code of the button outline color.#8080808a
buttonBorderRadiusnumberThe value of the border-radius CSS property in pixels.4px
closeOnOutsideClickbooleanIf true, closes the dropdown menu on click anywhere outside of the menu.true

Development

Check out the component and help development with

git clone https://github.com/danielyuenhx/react-dropdown-animated.git
cd react-dropdown-animated
npm install

Start the development server with

npm start