Menu | jaspr_daisyui_components
jaspr_daisyui_components
pub.dev ↗

Menu

Menu is used to display a list of links vertically or horizontally.

Class name Type Description
menu Component For <ul> tag
menu-title Part Styles a <li> as title. Title is not interactive
menu-dropdown Part For the collapsible <ul> if you want to show it using JS
menu-dropdown-toggle Part For the toggle to show/hide the menu-dropdown using JS
menu-disabled Modifier For the element inside <li> to look disabled
menu-active Modifier For the element inside <li> to look active
menu-focus Modifier For the element inside <li> to look focused
menu-dropdown-show Modifier Shows the menu-dropdown-toggle and menu-dropdown collapsible submenu using JS
menu-paged Modifier Shows one level at a time and turns the open summary into a back button
menu-xs Size Extra small size
menu-sm Size Small size
menu-md Size Medium size
menu-lg Size Large size
menu-xl Size Extra large size
menu-vertical Direction Vertical menu (default)
menu-horizontal Direction Horizontal menu

Responsive: vertical on small screen, horizontal on large screen

<ul class="menu menu-vertical lg:menu-horizontal bg-base-200 rounded-box">
  <li><a>Item 1</a></li>
  <li><a>Item 2</a></li>
  <li><a>Item 3</a></li>
</ul>
Menu(
  [
    li([a([Component.text('Item 1')], href: '#')]),
    li([a([Component.text('Item 2')], href: '#')]),
    li([a([Component.text('Item 3')], href: '#')]),
  ],
  classes: 'lg:menu-horizontal bg-base-200 rounded-box',
  direction: MenuDirection.vertical,
);

Paged menu with nested submenus

<ul class="menu menu-paged menu-vertical bg-base-200 rounded-box w-56 lg:w-auto">
  <li><a>Home</a></li>
  <li><a>About</a></li>
  <li>
    <details>
      <summary>Products</summary>
      <ul>
        <li><a>All products</a></li>
        <li><a>Electronics</a></li>
        <li><a>Clothing</a></li>
      </ul>
    </details>
  </li>
</ul>
Menu(
  [
    li([a([Component.text('Home')], href: '#')]),
    li([a([Component.text('About')], href: '#')]),
    li(
      [
        details(
          [
            summary([Component.text('Products')]),
            ul(
              [
                li([a([Component.text('All products')], href: '#')]),
                li([a([Component.text('Electronics')], href: '#')]),
                li([a([Component.text('Clothing')], href: '#')]),
              ],
            ),
          ],
        ),
      ],
    ),
  ],
  classes: 'bg-base-200 rounded-box w-56 lg:w-auto',
  modifier: MenuModifier.paged,
  direction: MenuDirection.vertical,
);

Collapsible submenu

<ul class="menu bg-base-200 rounded-box w-56">
  <li><a>Item 1</a></li>
  <li>
    <details open="">
      <summary>Parent</summary>
      <ul>
        <li><a>Submenu 1</a></li>
        <li><a>Submenu 2</a></li>
        <li>
          <details open="">
            <summary>Parent</summary>
            <ul>
              <li><a>Submenu 1</a></li>
              <li><a>Submenu 2</a></li>
            </ul>
          </details>
        </li>
      </ul>
    </details>
  </li>
  <li><a>Item 3</a></li>
</ul>
Menu(
  [
    li([a([Component.text('Item 1')], href: '#')]),
    li(
      [
        details(
          [
            summary([Component.text('Parent')]),
            ul(
              [
                li([a([Component.text('Submenu 1')], href: '#')]),
                li([a([Component.text('Submenu 2')], href: '#')]),
                li(
                  [
                    details(
                      [
                        summary([Component.text('Parent')]),
                        ul(
                          [
                            li([a([Component.text('Submenu 1')], href: '#')]),
                            li([a([Component.text('Submenu 2')], href: '#')]),
                          ],
                        ),
                      ],
                      open: true,
                    ),
                  ],
                ),
              ],
            ),
          ],
          open: true,
        ),
      ],
    ),
    li([a([Component.text('Item 3')], href: '#')]),
  ],
  classes: 'bg-base-200 rounded-box w-56',
);

Collapsible submenu that works with class names

you can open/close the submenu by adding/removing menu-dropdown-show class using JS
<ul class="menu bg-base-200 rounded-box w-56">
  <li><a>Item 1</a></li>
  <li>
    <span class="menu-dropdown-toggle">Parent</span>
    <ul class="menu-dropdown">
      <li><a>Submenu 1</a></li>
      <li><a>Submenu 2</a></li>
    </ul>
  </li>
</ul>
<ul class="menu bg-base-200 rounded-box w-56">
  <li><a>Item 1</a></li>
  <li>
    <span class="menu-dropdown-toggle menu-dropdown-show">Parent</span>
    <ul class="menu-dropdown menu-dropdown-show">
      <li><a>Submenu 1</a></li>
      <li><a>Submenu 2</a></li>
    </ul>
  </li>
</ul>
Component.fragment([
  Menu(
    [
      li([a([Component.text('Item 1')], href: '#')]),
      li(
        [
          MenuDropdownToggle([Component.text('Parent')]),
          MenuDropdown(
            [
              li([a([Component.text('Submenu 1')], href: '#')]),
              li([a([Component.text('Submenu 2')], href: '#')]),
            ],
          ),
        ],
      ),
    ],
    classes: 'bg-base-200 rounded-box w-56',
  ),
  Menu(
    [
      li([a([Component.text('Item 1')], href: '#')]),
      li(
        [
          MenuDropdownToggle(
            [Component.text('Parent')],
            modifier: MenuDropdownToggleModifier.menudropdownshow,
          ),
          MenuDropdown(
            [
              li([a([Component.text('Submenu 1')], href: '#')]),
              li([a([Component.text('Submenu 2')], href: '#')]),
            ],
            classes: 'menu-dropdown-show',
          ),
        ],
      ),
    ],
    classes: 'bg-base-200 rounded-box w-56',
  ),
]);

File tree

<ul class="menu menu-xs bg-base-200 rounded-box max-w-xs w-full">
  <li>
    <a>
      <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
        <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
      </svg>
      resume.pdf
    </a>
  </li>
  <li>
    <details open="">
      <summary>
        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
          <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"></path>
        </svg>
        My Files
      </summary>
      <ul>
        <li>
          <a>
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
              <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
            </svg>
            Project-final.psd
          </a>
        </li>
        <li>
          <a>
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
              <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
            </svg>
            Project-final-2.psd
          </a>
        </li>
        <li>
          <details open="">
            <summary>
              <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"></path>
              </svg>
              Images
            </summary>
            <ul>
              <li>
                <a>
                  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"></path>
                  </svg>
                  Screenshot1.png
                </a>
              </li>
              <li>
                <a>
                  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"></path>
                  </svg>
                  Screenshot2.png
                </a>
              </li>
              <li>
                <details open="">
                  <summary>
                    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                      <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"></path>
                    </svg>
                    Others
                  </summary>
                  <ul>
                    <li>
                      <a>
                        <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                          <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"></path>
                        </svg>
                        Screenshot3.png
                      </a>
                    </li>
                  </ul>
                </details>
              </li>
            </ul>
          </details>
        </li>
      </ul>
    </details>
  </li>
  <li>
    <a>
      <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
        <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
      </svg>
      reports-final-2.pdf
    </a>
  </li>
</ul>
Menu(
  [
    li(
      [
        a(
          [
            RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
        <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
      </svg>'''),
            Component.text('resume.pdf'),
          ],
          href: '#',
        ),
      ],
    ),
    li(
      [
        details(
          [
            summary(
              [
                RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
          <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"></path>
        </svg>'''),
                Component.text('My Files'),
              ],
            ),
            ul(
              [
                li(
                  [
                    a(
                      [
                        RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
              <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
            </svg>'''),
                        Component.text('Project-final.psd'),
                      ],
                      href: '#',
                    ),
                  ],
                ),
                li(
                  [
                    a(
                      [
                        RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
              <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
            </svg>'''),
                        Component.text('Project-final-2.psd'),
                      ],
                      href: '#',
                    ),
                  ],
                ),
                li(
                  [
                    details(
                      [
                        summary(
                          [
                            RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"></path>
              </svg>'''),
                            Component.text('Images'),
                          ],
                        ),
                        ul(
                          [
                            li(
                              [
                                a(
                                  [
                                    RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"></path>
                  </svg>'''),
                                    Component.text('Screenshot1.png'),
                                  ],
                                  href: '#',
                                ),
                              ],
                            ),
                            li(
                              [
                                a(
                                  [
                                    RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                    <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"></path>
                  </svg>'''),
                                    Component.text('Screenshot2.png'),
                                  ],
                                  href: '#',
                                ),
                              ],
                            ),
                            li(
                              [
                                details(
                                  [
                                    summary(
                                      [
                                        RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                      <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"></path>
                    </svg>'''),
                                        Component.text('Others'),
                                      ],
                                    ),
                                    ul(
                                      [
                                        li(
                                          [
                                            a(
                                              [
                                                RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
                          <path stroke-linecap="round" stroke-linejoin="round" d="M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"></path>
                        </svg>'''),
                                                Component.text('Screenshot3.png'),
                                              ],
                                              href: '#',
                                            ),
                                          ],
                                        ),
                                      ],
                                    ),
                                  ],
                                  open: true,
                                ),
                              ],
                            ),
                          ],
                        ),
                      ],
                      open: true,
                    ),
                  ],
                ),
              ],
            ),
          ],
          open: true,
        ),
      ],
    ),
    li(
      [
        a(
          [
            RawText(r'''<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewbox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="h-4 w-4">
        <path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"></path>
      </svg>'''),
            Component.text('reports-final-2.pdf'),
          ],
          href: '#',
        ),
      ],
    ),
  ],
  classes: 'bg-base-200 rounded-box max-w-xs w-full',
  size: MenuSize.xs,
);

Horizontal menu

<ul class="menu menu-horizontal bg-base-200">
  <li><a>Item 1</a></li>
  <li><a>Item 2</a></li>
  <li><a>Item 3</a></li>
</ul>
Menu(
  [
    li([a([Component.text('Item 1')], href: '#')]),
    li([a([Component.text('Item 2')], href: '#')]),
    li([a([Component.text('Item 3')], href: '#')]),
  ],
  classes: 'bg-base-200',
  direction: MenuDirection.horizontal,
);

Horizontal submenu

<ul class="menu menu-horizontal bg-base-200 rounded-box">
  <li><a>Item 1</a></li>
  <li>
    <a>Parent</a>
    <ul>
      <li><a>Submenu 1</a></li>
      <li><a>Submenu 2</a></li>
    </ul>
  </li>
  <li><a>Item 3</a></li>
</ul>
Menu(
  [
    li([a([Component.text('Item 1')], href: '#')]),
    li(
      [
        a([Component.text('Parent')], href: '#'),
        ul(
          [
            li([a([Component.text('Submenu 1')], href: '#')]),
            li([a([Component.text('Submenu 2')], href: '#')]),
          ],
        ),
      ],
    ),
    li([a([Component.text('Item 3')], href: '#')]),
  ],
  classes: 'bg-base-200 rounded-box',
  direction: MenuDirection.horizontal,
);

Mega menu with submenu (responsive)

<ul class="menu xl:menu-horizontal bg-base-200 rounded-box lg:min-w-max">
  <li>
    <a>Solutions</a>
    <ul>
      <li><a>Design</a></li>
      <li><a>Development</a></li>
      <li><a>Hosting</a></li>
      <li><a>Domain register</a></li>
    </ul>
  </li>
  <li>
    <a>Enterprise</a>
    <ul>
      <li><a>CRM software</a></li>
      <li><a>Marketing management</a></li>
      <li><a>Security</a></li>
      <li><a>Consulting</a></li>
    </ul>
  </li>
  <li>
    <a>Products</a>
    <ul>
      <li><a>UI Kit</a></li>
      <li><a>WordPress themes</a></li>
      <li><a>WordPress plugins</a></li>
      <li>
        <a>Open source</a>
        <ul>
          <li><a>Auth management system</a></li>
          <li><a>VScode theme</a></li>
          <li><a>Color picker app</a></li>
        </ul>
      </li>
    </ul>
  </li>
  <li>
    <a>Company</a>
    <ul>
      <li><a>About us</a></li>
      <li><a>Contact us</a></li>
      <li><a>Privacy policy</a></li>
      <li><a>Press kit</a></li>
    </ul>
  </li>
</ul>
Menu(
  [
    li(
      [
        a([Component.text('Solutions')], href: '#'),
        ul(
          [
            li([a([Component.text('Design')], href: '#')]),
            li([a([Component.text('Development')], href: '#')]),
            li([a([Component.text('Hosting')], href: '#')]),
            li([a([Component.text('Domain register')], href: '#')]),
          ],
        ),
      ],
    ),
    li(
      [
        a([Component.text('Enterprise')], href: '#'),
        ul(
          [
            li([a([Component.text('CRM software')], href: '#')]),
            li([a([Component.text('Marketing management')], href: '#')]),
            li([a([Component.text('Security')], href: '#')]),
            li([a([Component.text('Consulting')], href: '#')]),
          ],
        ),
      ],
    ),
    li(
      [
        a([Component.text('Products')], href: '#'),
        ul(
          [
            li([a([Component.text('UI Kit')], href: '#')]),
            li([a([Component.text('WordPress themes')], href: '#')]),
            li([a([Component.text('WordPress plugins')], href: '#')]),
            li(
              [
                a([Component.text('Open source')], href: '#'),
                ul(
                  [
                    li([a([Component.text('Auth management system')], href: '#')]),
                    li([a([Component.text('VScode theme')], href: '#')]),
                    li([a([Component.text('Color picker app')], href: '#')]),
                  ],
                ),
              ],
            ),
          ],
        ),
      ],
    ),
    li(
      [
        a([Component.text('Company')], href: '#'),
        ul(
          [
            li([a([Component.text('About us')], href: '#')]),
            li([a([Component.text('Contact us')], href: '#')]),
            li([a([Component.text('Privacy policy')], href: '#')]),
            li([a([Component.text('Press kit')], href: '#')]),
          ],
        ),
      ],
    ),
  ],
  classes: 'xl:menu-horizontal bg-base-200 rounded-box lg:min-w-max',
);

Collapsible with submenu (responsive)

<ul class="menu lg:menu-horizontal bg-base-200 rounded-box lg:mb-64">
  <li><a>Item 1</a></li>
  <li>
    <details open="">
      <summary>Parent item</summary>
      <ul>
        <li><a>Submenu 1</a></li>
        <li><a>Submenu 2</a></li>
        <li>
          <details open="">
            <summary>Parent</summary>
            <ul>
              <li><a>item 1</a></li>
              <li><a>item 2</a></li>
            </ul>
          </details>
        </li>
      </ul>
    </details>
  </li>
  <li><a>Item 3</a></li>
</ul>
Menu(
  [
    li([a([Component.text('Item 1')], href: '#')]),
    li(
      [
        details(
          [
            summary([Component.text('Parent item')]),
            ul(
              [
                li([a([Component.text('Submenu 1')], href: '#')]),
                li([a([Component.text('Submenu 2')], href: '#')]),
                li(
                  [
                    details(
                      [
                        summary([Component.text('Parent')]),
                        ul(
                          [
                            li([a([Component.text('item 1')], href: '#')]),
                            li([a([Component.text('item 2')], href: '#')]),
                          ],
                        ),
                      ],
                      open: true,
                    ),
                  ],
                ),
              ],
            ),
          ],
          open: true,
        ),
      ],
    ),
    li([a([Component.text('Item 3')], href: '#')]),
  ],
  classes: 'lg:menu-horizontal bg-base-200 rounded-box lg:mb-64',
);