Drawer 抽屉

抽屉是一种可以显示/隐藏页面左侧或右侧的侧边栏的网格布局。

类名
类型
drawer 组件类 The root container
drawer-toggle 组件类 For the hidden checkbox that controls the drawer
drawer-content 组件类 Container for all page content
drawer-side 组件类 The sidebar container
drawer-overlay 组件类 The label covers the content when drawer is open
drawer-end
装饰类
puts drawer to the right
drawer-open
响应类
Forces the drawer to be open

Drawer tags structure

.drawer // The root container
  ├── .drawer-toggle // A hidden checkbox to toggle the visibility of the sidebar
  ├── .drawer-content // All your page content goes here
  │    ├── // navbar
  │    ├── // content
  │    ╰── // footer
  ╰── .drawer-side // Sidebar wrapper
       ├── .drawer-overlay // A dark overlay that covers the whole page when the drawer is open
       ╰── // Sidebar content (menu or anything)
抽屉式侧边栏默认是隐藏的。你可以使用 lg:drawer-open 类名来在大屏幕上显示它(或者使用其他响应式前缀: sm, md, lg, xl
You can check/uncheck the checkbox using JavaScript or by clicking the <label> tag which is assigned to the hidden checkbox
# Drawer
# Responsive
Sidebar is always visible on large screen, can be toggled on small screen because of lg:drawer-open class
# Drawer that opens from right side of page
daisyUI store

New template: SaaS Landing page

Available on daisyUI store

More details