Dropdown 下拉菜单

下拉菜单可以在点击按钮时打开菜单或其他元素。

类名
类型
dropdown 组件类 Container element
dropdown-content 组件类 Container for content
dropdown-end
装饰类
Aligns to end
dropdown-top
装饰类
Open from top
dropdown-bottom
装饰类
Open from bottom
dropdown-left
装饰类
Open from left
dropdown-right
装饰类
Open from right
dropdown-hover
装饰类
Opens on hover too
dropdown-open
装饰类
Force open

Method 1: using details and summary tags

Method 2: Using CSS focus

We can't use <button> here because Safari has a bug that prevents the button from being focused.
<div role="button" tabindex="0"> is a workaround for this bug.
It is accessible and works in all browsers.

Positions

Open on hover

Force open

# Force open

More examples

# Card as dropdown
# Helper dropdown
A normal text and a helper dropdown
daisyUI store

New template: SaaS Landing page

Available on daisyUI store

More details