Menu
드롭다운 하위 메뉴 및 다양한 레이아웃 (데스크탑 상단, 사이드바, 하단 탭) 지원을 포함하여 최상위 앱 탐색을 위한 반응형이고 유연한 구조를 제공하는 탐색 구성 요소입니다.
사용 시기
탐색 메뉴는 웹 사이트에서 중요하며 사용자가 한 사이트 섹션에서 다른 섹션으로 빠르게 이동할 수 있도록 도와줍니다. 대부분 상단 탐색 및 측면 탐색이 포함됩니다. 상단 탐색은 웹 사이트의 모든 범주 및 기능을 제공합니다. 측면 탐색은 웹 사이트의 다단계 구조를 제공합니다.
데스크탑 상단 탐색
`desktopTop` 변형을 사용하여 데스크탑 레이아웃에 적합한 클래식한 상단 탐색 표시줄입니다.
astro
<Menu variant="desktopTop" class="rounded-lg shadow-sm border border-zinc-200 dark:border-zinc-800 overflow-visible relative z-10">
<MenuItem label="Home" variant="desktopTopActive" href="#" />
<MenuItem label="Products" variant="desktopTop" showChevron={true}>
<div slot="submenu" class="flex flex-col gap-2 p-2 w-48">
<a href="#" class="text-sm hover:text-blue-600 flex items-center gap-2">
<Icon name="Laptop" class="w-4 h-4"/> Computers
</a>
<a href="#" class="text-sm hover:text-blue-600 flex items-center gap-2">
<Icon name="Smartphone" class="w-4 h-4"/> Phones
</a>
<a href="#" class="text-sm hover:text-blue-600 flex items-center gap-2">
<Icon name="Watch" class="w-4 h-4"/> Accessories
</a>
</div>
</MenuItem>
<MenuItem label="About" variant="desktopTop" href="#" />
</Menu> 사이드바 탐색
일반적으로 대시보드에서 사용되는 수직 탐색 구조입니다.
astro
<Menu variant="desktopSide">
<MenuItem label="Dashboard" icon="LayoutDashboard" variant="sidebarActive" href="#" />
<MenuItem label="Analytics" icon="ChartLine" variant="sidebar" href="#" />
<MenuItem label="Settings" icon="Settings" variant="sidebar" href="#" />
</Menu> 모바일 상단 탐색
모바일 레이아웃을 위해 특별히 설계된 상단 탐색 표시줄입니다.
Mobile Content
astro
<Menu variant="mobileTop">
<div class="font-bold text-lg">App Logo</div>
<button class="p-2 -mr-2 text-zinc-600 dark:text-zinc-400">
<Icon name="Menu" class="w-6 h-6"/>
</button>
</Menu> 하단 탭 탐색
모바일 응용 프로그램에서 일반적으로 사용되며 탐색 요소를 화면 하단에 배치합니다.
Mobile Content
astro
<Menu variant="bottomTab">
<MenuItem label="Home" icon="House" variant="bottomTabActive" href="#" />
<MenuItem label="Search" icon="Search" variant="bottomTab" href="#" />
<MenuItem label="Profile" icon="User" variant="bottomTab" href="#" />
</Menu> API Reference
Menu
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| variant | The layout variant of the navigation bar. | 'bottomTab' | 'mobileTop' | 'desktopSide' | 'desktopTop' | 'bottomTab' |
| class | Additional CSS classes to apply to the Menu. | string | - |
MenuItem
| 속성 | 설명 | 타입 | 기본값 |
|---|---|---|---|
| variant | The styling variant of the navigation item. | 'sidebar' | 'sidebarActive' | 'bottomTab' | 'bottomTabActive' | 'desktopTop' | 'desktopTopActive' | 'sidebar' |
| label | The text label for the navigation item. | string | - |
| href | The URL the item links to. | string | - |
| icon | The name of the Lucide icon to display. | IconName | - |
| showChevron | Whether to show a chevron icon when a submenu is present. | boolean | true |
| disabled | Whether the item is disabled. | boolean | false |
| nested | Whether this menu item is nested inside another menu item, adjusting its submenu placement. | boolean | false |
| class | Additional CSS classes to apply to the NavItem. | string | - |