跳到正文
FunCoding

design-menus-and-pickers

Polish: apply in a polish or review pass on existing UI, not while first designing a page; a first build only needs the basics right. Details that make dropdowns, context menus, submenus and multi-select pickers (labels, tags, assignees) feel right: open animation from the trigger in the direction the menu opens, a safe triangle so diagonal moves into a submenu don't close it, a pre-focused filter input with arrow-key navigation, selected items grouped at the top on open but never reordered while the menu is open, and shortcuts shown inline. Use when polishing or reviewing a dropdown, menu, submenu, popover, combobox, select, label/tag picker or command menu, or when one 'feels clunky' compared to Linear's.

Star
749
最近提交
2026年11月30日

skills/design-menus-and-pickers/SKILL.md

在 GitHub 上查看

When: polish. While first building a page, use a solid menu/combobox primitive (Radix, Base UI, Floating UI, or the repo's existing component) and move on; these details are applied in a polish pass, on new or existing UI.

Two pickers can look identical and feel completely different. The difference is a handful of behaviors, each small. Related: design-tooltips, design-purposeful-motion.

Opening

  • Animate out of the trigger. Set transform-origin to the corner nearest the trigger and scale/translate from there. A menu opening down-right grows down-right; one flipped up-left (near the screen edge) grows up-left. Recompute origin after collision flipping. A menu that grows from its own center, or from the wrong corner, feels detached.
  • Keep it short (~120–180ms ease-out in, faster or none out). Menus are used constantly.

People move diagonally from the parent item toward the lower items of a submenu, crossing sibling items on the way. Without help, the submenu closes mid-move.

  • While the pointer is inside the triangle between its last position and the near edge of the open submenu, don't switch the active item. Optionally add a short (~100–300ms) grace delay before switching.
  • Radix/Base UI/Floating UI (safePolygon) implement this; use them rather than hand-rolling. Test it by moving diagonally to the bottom item.

Multi-select pickers (labels, tags, assignees)

  • Focus the filter input on open. Typing filters immediately; ↑/↓ moves, Enter toggles, Escape closes. No mouse needed.
  • On open, group selected items at the top, then the rest.
  • Never reorder while open. When the user toggles an item, it stays exactly where it is. Moving it to the top would make them hunt for it to undo a misclick. Regroup only the next time the menu opens. Same in reverse when deselecting.
  • Keep the highlighted row stable as the list filters; reset highlight to the first match on new input.
  • Offer "create" for a new value inline at the bottom when the filter has no exact match.

Everywhere

  • Show the keyboard shortcut right-aligned on each menu item that has one.
  • Resizable panels show a hint on hover (cursor + subtle handle), and clicking the edge toggles collapse.
  • Open on pointer-down for menus people use rapidly; preload menu content when the pointer approaches the trigger.

Checklist

  • transform-origin matches the actual opening direction, including flipped placements
  • Diagonal move to the last submenu item works
  • Picker opens with focus in the filter; full keyboard flow
  • Selected grouped on open; toggled items don't move while open
  • Shortcuts visible in menu items

相似的 Skill

blender-motion-state-inspection

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

官方

slack-gif-creator

ANanthropics/skills203k近 7 天新增 3,265 个 star

精选

algorithmic-art

用 p5.js 生成流场和粒子系统,通过种子随机性创作原创算法艺术。

ANanthropics/skills203k近 7 天新增 3,265 个 star

moneyprinterturbo-video

HAharry0703/MoneyPrinterTurbo147k近 7 天新增 1,608 个 star

thinking-out-loud

SHShubhamsaboo/awesome-llm-apps147k近 7 天新增 907 个 star

design-motion

GAgarrytan/gstack143k近 7 天新增 598 个 star