Dropdown Menu

Description

A dropdown menu is a user interface component that allows users to choose one option from a list of choices. It is typically triggered by a button or a similar control and displays a list of options that can be selected.

The dropdown menu can use the DropdownMenuList component to automatically render the dropdown menu from an array, or it can be manually constructed by using the DropdownMenuGroup, DropdownMenuLabel, and DropdownMenuItem components.

The buttonEl prop can take either a string or an element like an icon.

Preview

Installation

Add component:

Usage

Code

components/ui/dropdown-menu.tsx