Dropdown components you can take apart
Dropdowns are the thing everyone thinks they know. You open a menu, you pick an item, done. But try building one that actually feels good and you’re suddenly dealing with hover delays, animation timing, diagonal mouse paths, and physics simulations for a fan speed controller that nobody asked for.
I wanted to see how deep it goes. Seven sections, each taking one piece apart. Toggles to flip between variants, code you can copy.
01 / Trigger States
The button you click before anything happens. Four styles, each handling hover, press, and open states.
Outline and Ghost are safe picks for toolbars and secondary actions. Solid works when the dropdown is the primary action on the page. Gradient is personality, brand-heavy interfaces where the trigger needs to stand out.
02 / Open Animations
You clicked the trigger. Now what? The menu can open four ways. Fade, scale, slide, and spring physics.
Fade and Slide are safe for any context. Scale works when the menu needs to feel connected to its trigger. Spring adds personality but can feel heavy in dense interfaces. Exit is always faster than enter. Slower exit feels like lag.
03 / Menu Appearance
Same six items, four shadow styles. This is what makes a dropdown stop looking like a browser default.
Elevated and Layered fit productivity tools where the menu needs to feel solid. Glass works over rich backgrounds, images, or video. Soft disappears into light interfaces where the menu shouldn’t compete for attention.
04 / Item Hover Effects
The menu is open. Which row are you pointing at?
Fill is the safe default for any menu. Accent adds a left bar that draws the eye on long lists. Gradient works over dark backgrounds where a solid fill would clash. Combine them when the hover needs to do more work.
05 / Submenu
Menus inside menus. Flyout keeps both levels visible at once. Drill-down replaces the current view entirely. Two different mental models for the same problem.
Flyout works for desktop context menus and short hierarchies. Breaks on touch. Drill-down fits everywhere, mobile nav, settings panels, anywhere the screen is narrow or each level is self-contained. Click in, click back.
06 / Safe Triangle
The thing that makes submenus actually work. Without it, moving diagonally toward a submenu crosses other rows and the panel closes. Try it on the left. Then try the right.
Left demo is naive hover. Whatever row you touch becomes active, submenu closes instantly. Right demo solves it. Toggle the debug overlay to watch it in real time.
07 / List Item Types
Past the basics. Three menu patterns you won’t find in standard component libraries. An audio mixer, a tag manager with inline color editing, and a fan speed controller with physical momentum.
Mixer puts channel faders inside a dropdown. Color Tags handles inline editing with remove animations. Fan Speed adds physical inertia to a slider. None of these belong in a standard component library. They’re what happens when a dropdown stops being a list of links.
08 / Get the source
Every component from every section is in one repo. React, motion, Tailwind, and lucide-react for the icons. Keyboard nav and ARIA roles are built in but not the focus of this lab. Including the fan speed controller that nobody asked for. Clone it, break it apart, rebuild it however you want.