Use .dropdown to create a dropdown element and .dropdown-menu to create a dropdown menu. By default, dropdown menu items are styled using .dropdown-item.
Dropdown menu functionality is provided using Alpine JS, which you can apply by adding x-data="dropdown" to the .dropdown element. The element used to toggle the menu must have a x-ref="toggle" property and the dropdown menu itself must have a x-ref="menu" property.
States
Active
Use our standard .is-active modifier class to identify a .dropdown-item as active:
Or through the use of the [aria-selected] attribute, which mirrors the styles applied to Zendesk’s application dropdown menus:
Disabled
Use .is-disabled to dropdown items to style a .dropdown-item as disabled:
Content
Mixed content
Add any type of content to dropdown items using text utilities.
Dividers
Groups of related menu items can be separated using a divider.
Questions or feedback about this article? Let us know
Verify purchase
Provide details about your purchase to unlock this and other code examples throughout the website.