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*.

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