Skip to content

Commit 1028222

Browse files
authored
feat(component): add <MegaMenu/> (#1331)
This time, use the new monorepo!
1 parent 1ffd9dc commit 1028222

20 files changed

+2266
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: React Mega Menu - Flowbite
3+
description: Use the mega menu component as a full-width dropdown inside the navbar to show a list of menu items based on multiple sizes, variants, and styles.
4+
---
5+
6+
The mega menu component is a full-width dropdown that can be triggered by clicking on the menu item and it shows a list of links that you can use to navigate through the pages on a website.
7+
8+
To start using the mega menu component you need to import it from `flowbite-react`:
9+
10+
```jsx
11+
import { MegaMenu } from "flowbite-react";
12+
```
13+
14+
## Default mega menu
15+
16+
Use this example to show a list of links aligned on three columns inside the mega menu dropdown.
17+
18+
<Example name="megaMenu.root" />
19+
20+
## Mega menu with icons
21+
22+
This example of a mega menu dropdown can be used to also show an icon near the text of the link.
23+
24+
<Example name="megaMenu.icons" />
25+
26+
## Full width dropdown
27+
28+
Use this example to show a mega menu dropdown that spans the entire width of the document page.
29+
30+
<Example name="megaMenu.fullWidth" />
31+
32+
## Full width with CTA
33+
34+
This example can be used to also show a CTA button or link next to the menu items inside the dropdown.
35+
36+
<Example name="megaMenu.fullWidthCTA" />
37+
38+
## Full width with image
39+
40+
This example can be used to also show a CTA with a background image inside the dropdown next to the other menu items and links.
41+
42+
<Example name="megaMenu.fullWidthImage" />
43+
44+
## Theme
45+
46+
Note:
47+
48+
- `<MegaMenu>`'s theme has all of the same options as [`<Navbar>`](https://flowbite-react.com/docs/components/navbar)'s, with slightly different defaults
49+
- `<MegaMenu.Dropdown toggle={..} />`'s theme, `megaMenu.dropdown.toggle`, is identical to [`<Dropdown>`](https://flowbite-react.com/docs/components/dropdown), with slightly different defaults
50+
51+
<Theme name="megaMenu" />
52+
53+
## References
54+
55+
- [Flowbite Mega Menu](https://flowbite.com/docs/components/mega-menu/)

apps/web/data/docs-sidebar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export const DOCS_SIDEBAR: DocsSidebarSection[] = [
7070
{ title: "Forms", href: "/docs/components/forms" },
7171
{ title: "KBD", href: "/docs/components/kbd", isNew: true },
7272
{ title: "List group", href: "/docs/components/list-group" },
73+
{ title: "Mega menu", href: "/docs/components/mega-menu", isNew: true },
7374
{ title: "Modal", href: "/docs/components/modal" },
7475
{ title: "Navbar", href: "/docs/components/navbar" },
7576
{ title: "Pagination", href: "/docs/components/pagination" },

apps/web/examples/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export * as forms from "./forms";
1919
export * as kbd from "./kbd";
2020
export * as list from "./list";
2121
export * as listGroup from "./listGroup";
22+
export * as megaMenu from "./megaMenu";
2223
export * as modal from "./modal";
2324
export * as navbar from "./navbar";
2425
export * as pagination from "./pagination";

apps/web/examples/megaMenu/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export { root } from "./megaMenu.root";
2+
export { icons } from "./megaMenu.icons";
3+
export { fullWidth } from "./megaMenu.fullWidth";
4+
export { fullWidthCTA } from "./megaMenu.fullWidthCTA";
5+
export { fullWidthImage } from "./megaMenu.fullWidthImage";

0 commit comments

Comments
 (0)