Skip to content

feat(navigation): Dropdown Menu with keyboard navigation and animations #453

Description

@KeenIsHere

Overview

This issue proposes adding a Dropdown Menu component to the navigation category of Animata.

A dropdown menu is one of the most commonly needed UI patterns in SaaS and web applications. Animata currently has no navigation dropdown — this fills that gap with a fully accessible, animated, copy-paste-ready component.


Component Details

File: animata/navigation/dropdown-menu.tsx
Category: Navigation
Type: Interactive component


Proposed Features

  • Trigger button that opens and closes a dropdown panel below it
  • Menu items with optional icon and label support
  • Smooth open/close animation using framer-motion (opacity + translateY only)
  • Keyboard navigation: Arrow Up/Down to move, Enter to select, Escape to close
  • Click outside to close using a ref and useEffect mousedown listener
  • Focus management: returns focus to trigger on Escape
  • Fully accessible: aria-expanded, aria-haspopup, role="menu", role="menuitem"
  • prefers-reduced-motion: animations disabled when user preference is set
  • Mobile ready: tap to open and close
  • Left and right alignment support via prop

Props API

interface MenuItem {
  label: string;
  icon?: React.ReactNode;
  onClick?: () => void;
}

interface DropdownMenuProps {
  items?: MenuItem[];
  triggerLabel?: string;
  align?: "left" | "right";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions