Menu

A sleek, interactive component that reveals options on click, perfect for seamless navigation and organizing choices in a compact space.

If you are using Tailwind v4, please refer to the 2.x documentation. This documentation assumes you are using Tailwind v3.

Basic

A menu presents a variety of actions or options from which you can choose.

Installation

If you hit any issues, make sure you check out the installation guide here.

Composed Components

When you plug this component from the CLI, it autoloads all the composed components. No need to toss 'em in one at a time.

The Menu's decked out with several components to make it bangin'.

Keyboard

Keyboard and focus support ensures smooth navigation with keys, essential for users without a mouse and appreciated by power users for quick access.

Dropdown

Dropdown's a slick component used in other parts of your project that need dropdown, like menu, select, combo box, and more.

Manual Installation

Sometimes, using the CLI is the way to go, so make sure you install the necessary dependencies for the components you want to use.

Anatomy

Import the components and use them as shown below, adapting the structure to fit each component.

Menu can be nested to display submenus.

Respect Screen

By default, the menu will respect the screen size, when it lower than 600px, it will be displayed as a modal slide from the bottom. You can disable this behavior by setting respectScreen to false.

Danger

Designate a menu item as dangerous.

With Icon

Enhance menu items by adding icons.

Dynamic Menu

Generate menu items dynamically.

Multiple Menu

Display a selection of actions or options.

Single Menu

Present a single list of options.

Section Menu

Organize menu items into grouped sections.

Section-Level Selection

Organize menu items into grouped sections with level selection.

Arrow

Incorporate an arrow into the menu using the showArrow prop on Menu.Content.

Item Details

You can add details to menu items by using the Menu.ItemDetails component.

Disabled

Disable specific menu items.

Also, you can disable items directly in Menu.Content by using the disabledKeys prop.

<Menu.Content disabledKeys={['gsu']} />

Open Modal

Trigger a modal from a menu item. Refer to the modal demo for further information.