UNPKG

react-dropdown-animated

Version:

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

28 lines (26 loc) 605 B
import React from 'react'; import { motion } from 'framer-motion'; const DropdownOptions = ({ options, initial, exit }) => { return /*#__PURE__*/React.createElement(motion.div, { initial: { opacity: 0, y: `-${initial}%` }, animate: { opacity: 1, y: '0%' }, exit: { opacity: -1, y: `-${exit}%` }, className: "dropdown-options" }, /*#__PURE__*/React.createElement("ul", {options}, options.map(option => /*#__PURE__*/React.createElement("li", { onClick: option.onClick }, option.content)))); }; export default DropdownOptions;