Menu
Modifier | DaisyUI class |
---|---|
:xs | menu-xs |
:sm | menu-sm |
:md | menu-md |
:lg | menu-lg |
:vertical | menu-vertical |
:horizontal | menu-horizontal |
:primary | bg-primary text-primary-content |
:secondary | bg-secondary text-secondary-content |
:accent | bg-accent text-accent-content |
:neutral | bg-neutral text-neutral-content |
:base_100 | bg-base-100 text-base-content |
:base_200 | bg-base-200 text-base-content |
:base_300 | bg-base-300 text-base-content |
:info | bg-info text-info-content |
:success | bg-success text-success-content |
:warning | bg-warning text-warning-content |
:error | bg-error text-error-content |
# Menu
1 Menu :base_200, class: "rounded-box w-56" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do 9 a do 10"Item 2"
11end
12end
13 14 menu.item do 15 a do 16"Item 3"
17end
18end
19end
# Responsive: vertical on small screen, horizontal on large screen
1 Menu :base_200, :vertical, responsive: {lg: :horizontal}, class: "rounded-box" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do 9 a do 10"Item 2"
11end
12end
13 14 menu.item do 15 a do 16"Item 3"
17end
18end
19end
# Menu with icon only
1 Menu :base_200, class: "rounded-box" do |menu| 2 menu.item do 3 a do 4house_svg
5end
6end
7 8 menu.item do 9 a do 10info_svg
11end
12end
13 14 menu.item do 15 a do 16chart_svg
17end
18end
19end
# Menu with icon only (horizontal)
1 Menu :horizontal, :base_200, class: "rounded-box" do |menu| 2 menu.item do 3 a do 4house_svg
5end
6end
7 8 menu.item do 9 a do 10info_svg
11end
12end
13 14 menu.item do 15 a do 16chart_svg
17end
18end
19end
# Menu with icon only with tooltip
1 Menu :base_200, class: "rounded-box" do |menu| 2 menu.item do 3 Tooltip :right, tip: "Home" do 4 a do 5house_svg
6end
7end
8end
9 10 menu.item do 11 Tooltip :right, tip: "Details" do 12 a do 13info_svg
14end
15end
16end
17 18 menu.item do 19 Tooltip :right, tip: "Stats" do 20 a do 21chart_svg
22end
23end
24end
25end
# Menu with icon only (horizontal) with tooltip
1 Menu :horizontal, :base_200, class: "rounded-box" do |menu| 2 menu.item do 3 Tooltip tip: "Home" do 4 a do 5house_svg
6end
7end
8end
9 10 menu.item do 11 Tooltip tip: "Details" do 12 a do 13info_svg
14end
15end
16end
17 18 menu.item do 19 Tooltip tip: "Stats" do 20 a do 21chart_svg
22end
23end
24end
25end
# Menu sizes
1 Menu :xs, :base_200, class: "rounded-box w-56" do |menu| 2 menu.item do 3 a do 4"xs item 1"
5end
6end
7 8 menu.item do 9 a do 10"xs item 2"
11end
12end
13end
14 15 Menu :sm, :base_200, class: "rounded-box w-56" do |menu| 16 menu.item do 17 a do 18"sm item 1"
19end
20end
21 22 menu.item do 23 a do 24"sm item 2"
25end
26end
27end
28 29 Menu :md, :base_200, class: "rounded-box w-56" do |menu| 30 menu.item do 31 a do 32"md item 1"
33end
34end
35 36 menu.item do 37 a do 38"md item 2"
39end
40end
41end
42 43 Menu :lg, :base_200, class: "rounded-box w-56" do |menu| 44 menu.item do 45 a do 46"lg item 1"
47end
48end
49 50 menu.item do 51 a do 52"lg item 2"
53end
54end
55end
# Menu with disabled items
1 Menu :base_200, class: "rounded-box w-56" do |menu| 2 menu.item do 3 a do 4"Enabled item"
5end
6end
7 8 menu.item :disabled do 9 a do 10"disabled item"
11end
12end
13 14 menu.item :disabled do 15 a do 16"disabled item"
17end
18end
19end
# With icons component
1 Menu :base_200, class: "rounded-box w-56" do |menu| 2 menu.item do 3 a do 4house_svg
5 plain "Item 1" 6end
7end
8 9 menu.item do 10 a do 11info_svg
12 plain "Item 2" 13end
14end
15 16 menu.item do 17 a do 18chart_svg
19 plain "Item 3" 20end
21end
22end
# Menu with icons and badge (responsive)
1 Menu :base_200, responsive: {lg: :horizontal}, class: "rounded-box flex-nowrap" do |menu| 2 menu.item do 3 a do 4house_svg
5 plain "Inbox" 6 Badge :sm do 7"99+"
8end
9end
10end
11 12 menu.item do 13 a do 14info_svg
15 plain "Updates" 16 Badge :sm, :warning do 17"NEW"
18end
19end
20end
21 22 menu.item do 23 a do 24 plain "Stats" 25 Badge :xs, :info 26end
27end
28end
# Menu without padding and border radius
1 Menu :base_200, class: "w-56 p-0 [&_li>*]:rounded-none" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do 9 a do 10"Item 2"
11end
12end
13 14 menu.item do 15 a do 16"Item 3"
17end
18end
19end
# Menu with title
1 Menu :base_200, class: "w-56" do |menu| 2 menu.title do 3"Title"
4end
5 6 menu.item do 7 a do 8"Item 1"
9end
10end
11 12 menu.item do 13 a do 14"Item 2"
15end
16end
17 18 menu.item do 19 a do 20"Item 3"
21end
22end
23end
# Menu with title as a parent
1 Menu :base_200, class: "w-56" do |menu| 2 menu.item do |item| 3 item.title do 4"Title"
5end
6 7 item.submenu do |submenu| 8 submenu.item do 9 a do 10"Item 1"
11end
12end
13 14 submenu.item do 15 a do 16"Item 2"
17end
18end
19 20 submenu.item do 21 a do 22"Item 3"
23end
24end
25end
26end
27end
# Submenu
1 Menu :base_200, class: "w-56" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do |item| 9 a do 10"Parent as link"
11end
12 13 item.submenu do |submenu| 14 submenu.item do 15 a do 16"Submenu 1"
17end
18end
19 20 submenu.item do 21 a do 22"Submenu 2"
23end
24end
25 26 submenu.item do |item| 27 item.title do 28"Parent as title"
29end
30 31 item.submenu do |submenu| 32 submenu.item do 33 a do 34"Submenu 1"
35end
36end
37 38 submenu.item do 39 a do 40"Submenu 2"
41end
42end
43end
44end
45end
46end
47 48 menu.item do 49 a do 50"Item 3"
51end
52end
53end
# Combined
1 Menu class: "bg-base-200 w-52" do |menu| 2 menu.title do 3"My Menu"
4end
5 6 menu.item :disabled do 7 a do 8"Item 1"
9end
10end
11 12 menu.item do |item| 13 item.submenu :collapsible, :open do |submenu| 14 submenu.title do 15"Parent 1"
16end
17 18 submenu.item do |submenu_item| 19 a do 20"Child 1"
21end
22end
23 24 submenu.item do |submenu_item| 25 submenu_item.submenu :collapsible do |submenu_2| 26 submenu_2.title do 27"Parent 2"
28end
29 30 submenu_2.item do 31 a do 32"Child 2"
33end
34end
35end
36end
37 38 submenu.item do |submenu_item| 39 submenu_item.submenu do |submenu_2| 40 submenu_2.title do 41"Parent 3"
42end
43 44 submenu_2.item do 45 a do 46"Child 3"
47end
48end
49end
50end
51end
52end
53 54 menu.item do |item| 55 item.submenu do |submenu| 56 submenu.title do 57"Parent 1"
58end
59 60 submenu.item do 61 a do 62"Child 1"
63end
64end
65 66 submenu.item do |item| 67 item.submenu do |submenu_2| 68 submenu_2.title do 69"Parent 2"
70end
71 72 submenu_2.item do 73 a do 74"Child 2"
75end
76end
77end
78end
79end
80end
81end
# Collapsible submenu
1 Menu :base_200, class: "rounded-box w-56" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do |item| 9 item.submenu :collapsible, :open do |submenu| 10 submenu.title do 11"Parent"
12end
13 14 submenu.item do 15 a do 16"Submenu 1"
17end
18end
19 20 submenu.item do 21 a do 22"Submenu 2"
23end
24end
25 26 submenu.item do |submenu_item| 27 submenu_item.submenu :collapsible, :open do |submenu_2| 28 submenu_2.title do 29"Parent"
30end
31 32 submenu_2.item do 33 a do 34"Submenu 1"
35end
36end
37 38 submenu_2.item do 39 a do 40"Submenu 2"
41end
42end
43end
44end
45end
46end
47end
# File tree
1 Menu :base_200, :xs, class: "rounded-lg w-full max-w-xs" do |menu| 2 menu.item do 3 a do 4blank_file_svg
5 plain "resume.pdf" 6end
7end
8 9 menu.item do |item| 10 item.submenu :collapsible, :open do |submenu| 11 submenu.title do 12folder_svg
13 plain "My Files" 14end
15 16 submenu.item do 17 a do 18blank_file_svg
19 plain "Project-final.psd" 20end
21end
22 23 submenu.item do 24 a do 25blank_file_svg
26 plain "Project-final-2.psd" 27end
28end
29 30 submenu.item do |submenu_item| 31 submenu_item.submenu :collapsible, :open do |submenu_2| 32 submenu_2.title do 33folder_svg
34 plain "Images" 35end
36 37 submenu_2.item do 38 a do 39image_svg
40 plain "Screenshot1.png" 41end
42end
43 44 submenu_2.item do 45 a do 46image_svg
47 plain "Screenshot2.png" 48end
49end
50 51 submenu_2.item do |submenu_item| 52 submenu_item.submenu :collapsible do |submenu_3| 53 submenu_3.title do 54folder_svg
55 plain "Others" 56end
57 58 submenu_3.item do 59 a do 60image_svg
61 plain "Screenshot3.png" 62end
63end
64end
65end
66end
67end
68end
69end
70 71 menu.item do 72 a do 73blank_file_svg
74 plain "reports-final-2.pdf" 75end
76end
77end
# With active item
1 Menu :base_200, class: "w-56" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do 9 Link :active do 10"Item 2"
11end
12end
13 14 menu.item do 15 a do 16"Item 3"
17end
18end
19end
# Horizontal menu
1 Menu :horizontal, :base_200 do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do 9 a do 10"Item 2"
11end
12end
13 14 menu.item do 15 a do 16"Item 3"
17end
18end
19end
# Horizontal submenu
1 Menu :horizontal, :base_200 do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do |item| 9 a do 10"Parent"
11end
12 13 item.submenu do |submenu| 14 submenu.item do 15 a do 16"Submenu 1"
17end
18end
19 20 submenu.item do 21 a do 22"Submenu 2"
23end
24end
25end
26end
27 28 menu.item do 29 a do 30"Item 3"
31end
32end
33end
# Mega menu with submenu (responsive)
1 Menu :base_200, responsive: {lg: :horizontal}, class: "rounded-box lg:min-w-max" do |menu| 2 menu.item do |item| 3 a do 4"Solutions"
5end
6 7 item.submenu do |submenu| 8 submenu.item do 9 a do 10"Design"
11end
12end
13 14 submenu.item do 15 a do 16"Development"
17end
18end
19 20 submenu.item do 21 a do 22"Hosting"
23end
24end
25 26 submenu.item do 27 a do 28"Domain register"
29end
30end
31end
32end
33 34 menu.item do |item| 35 a do 36"Enterprise"
37end
38 39 item.submenu do |submenu| 40 submenu.item do 41 a do 42"CRM software"
43end
44end
45 46 submenu.item do 47 a do 48"Marketing management"
49end
50end
51 52 submenu.item do 53 a do 54"Security"
55end
56end
57 58 submenu.item do 59 a do 60"Consulting"
61end
62end
63end
64end
65 66 menu.item do |item| 67 a do 68"Products"
69end
70 71 item.submenu do |submenu| 72 submenu.item do 73 a do 74"UI Kit"
75end
76end
77 78 submenu.item do 79 a do 80"Wordpress themes"
81end
82end
83 84 submenu.item do 85 a do 86"Wordpress plugins"
87end
88end
89 90 submenu.item do |submenu_item| 91 a do 92"Open source"
93end
94 95 submenu_item.submenu do |submenu| 96 submenu.item do 97 a do 98"Auth management system"
99end
100end
101 102 submenu.item do 103 a do 104"VScode theme"
105end
106end
107 108 submenu.item do 109 a do 110"Color picker app"
111end
112end
113end
114end
115end
116end
117 118 menu.item do |item| 119 a do 120"Company"
121end
122 123 item.submenu do |submenu| 124 submenu.item do 125 a do 126"About us"
127end
128end
129 130 submenu.item do 131 a do 132"Contact us"
133end
134end
135 136 submenu.item do 137 a do 138"Privacy policy"
139end
140end
141 142 submenu.item do 143 a do 144"Press kit"
145end
146end
147end
148end
149end
# Collapsible with submenu (responsive)
1 Menu :base_200, responsive: {lg: :horizontal}, class: "rounded-box lg:mb-64" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do |item| 9 item.submenu :collapsible, :open do |submenu| 10 submenu.title do 11"Parent item"
12end
13 14 submenu.item do 15 a do 16"Submenu 1"
17end
18end
19 20 submenu.item do 21 a do 22"Submenu 2"
23end
24end
25 26 submenu.item do |submenu_item| 27 submenu_item.submenu :collapsible, :open do |submenu_2| 28 submenu_2.title do 29"Parent"
30end
31 32 submenu_2.item do 33 a do 34"item 1"
35end
36end
37 38 submenu_2.item do 39 a do 40"item 2"
41end
42end
43end
44end
45end
46end
47 48 menu.item do 49 a do 50"Item 3"
51end
52end
53end
# Menu without padding and border radius
1 Menu :base_200, class: "w-56 p-0 [&_li>*]:rounded-none" do |menu| 2 menu.item do 3 a do 4"Item 1"
5end
6end
7 8 menu.item do 9 a do 10"Item 2"
11end
12end
13 14 menu.item do 15 a do 16"Item 3"
17end
18end
19end