|
| 1 | +--- |
| 2 | +title: "Navigation Menu" |
| 3 | +description: "Accessible navigation menu with dropdown support" |
| 4 | +--- |
| 5 | + |
| 6 | +import { ComponentDemo, DemoGrid } from '@/app/components/ComponentDemo'; |
| 7 | + |
| 8 | +The Navigation Menu component provides an accessible menu for site navigation. |
| 9 | + |
| 10 | +## Basic Usage |
| 11 | + |
| 12 | +<ComponentDemo |
| 13 | + schema={{ |
| 14 | + type: 'navigation-menu', |
| 15 | + items: [ |
| 16 | + { |
| 17 | + label: 'Home', |
| 18 | + href: '/' |
| 19 | + }, |
| 20 | + { |
| 21 | + label: 'Products', |
| 22 | + items: [ |
| 23 | + { label: 'All Products', href: '/products' }, |
| 24 | + { label: 'New Arrivals', href: '/products/new' }, |
| 25 | + { label: 'Best Sellers', href: '/products/popular' } |
| 26 | + ] |
| 27 | + }, |
| 28 | + { |
| 29 | + label: 'About', |
| 30 | + href: '/about' |
| 31 | + }, |
| 32 | + { |
| 33 | + label: 'Contact', |
| 34 | + href: '/contact' |
| 35 | + } |
| 36 | + ] |
| 37 | + }} |
| 38 | + title="Site Navigation" |
| 39 | +/> |
| 40 | + |
| 41 | +## With Descriptions |
| 42 | + |
| 43 | +<ComponentDemo |
| 44 | + schema={{ |
| 45 | + type: 'navigation-menu', |
| 46 | + items: [ |
| 47 | + { |
| 48 | + label: 'Getting Started', |
| 49 | + items: [ |
| 50 | + { |
| 51 | + label: 'Introduction', |
| 52 | + description: 'Learn the basics', |
| 53 | + href: '/docs/intro' |
| 54 | + }, |
| 55 | + { |
| 56 | + label: 'Installation', |
| 57 | + description: 'Install the package', |
| 58 | + href: '/docs/install' |
| 59 | + }, |
| 60 | + { |
| 61 | + label: 'Quick Start', |
| 62 | + description: 'Build your first app', |
| 63 | + href: '/docs/quick-start' |
| 64 | + } |
| 65 | + ] |
| 66 | + } |
| 67 | + ] |
| 68 | + }} |
| 69 | + title="Documentation Nav" |
| 70 | +/> |
| 71 | + |
| 72 | +## Schema |
| 73 | + |
| 74 | +```typescript |
| 75 | +interface NavigationMenuItem { |
| 76 | + label: string; |
| 77 | + href?: string; |
| 78 | + description?: string; |
| 79 | + icon?: string; |
| 80 | + items?: NavigationMenuItem[]; // Submenu items |
| 81 | +} |
| 82 | + |
| 83 | +interface NavigationMenuSchema { |
| 84 | + type: 'navigation-menu'; |
| 85 | + items: NavigationMenuItem[]; // Menu items |
| 86 | + className?: string; |
| 87 | +} |
| 88 | +``` |
0 commit comments