Skip to main content
You are currently viewing the documentation for Filament 4.x, which is a previous version of Filament.Looking for the current stable version? Visit the 5.x documentation.

Introduction

The dropdown component allows you to render a dropdown menu with a button that triggers it:

Using the keyboard

Dropdowns use action-menu semantics by default. You can open the menu with Enter, Space or Arrow Down to focus the first item, or Arrow Up to focus the last item. Arrow Up and Arrow Down move between items and wrap at either end. Disabled items can receive focus but cannot be activated. Escape closes the menu and returns focus to its trigger; Tab closes it and moves to the next focusable control.

Displaying content other than a menu

If your dropdown contains form fields or other content that is not an action menu, set :menu="false" to preserve normal Tab navigation and the content’s own keyboard interactions:
Use form components or native buttons and links in these popups, rather than dropdown.list.item, which renders menu-item semantics. By default, a dropdown item’s underlying HTML tag is <button>. You can change it to be an <a> tag by using the tag attribute:

Changing the color of a dropdown item

By default, the color of a dropdown item is “gray”. You can change it to be danger, info, primary, success or warning by using the color attribute:

Adding an icon to a dropdown item

You can add an icon to a dropdown item by using the icon attribute:

Changing the icon color of a dropdown item

By default, the icon color uses the same color as the item itself. You can override it to be danger, info, primary, success or warning by using the icon-color attribute:

Adding an image to a dropdown item

You can add a circular image to a dropdown item by using the image attribute:

Adding a badge to a dropdown item

You can render a badge on top of a dropdown item by using the badge slot:
You can change the color of the badge using the badge-color attribute:

Setting the placement of a dropdown

The dropdown may be positioned relative to the trigger button by using the placement attribute:

Setting the width of a dropdown

The dropdown may be set to a width by using the width attribute. Options correspond to Tailwind’s max-width scale. The options are xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl and 7xl:

Controlling the maximum height of a dropdown

The dropdown content can have a maximum height using the max-height attribute, so that it scrolls. You can pass a CSS length: