문서 탐색

UINavigationMenu

사이트 헤더에 바로 이동하는 링크와 펼쳐서 찾는 링크 그룹을 배치합니다.

기본 사용법

사이트 헤더에서 페이지 탐색

상위 분류가 헤더에 나란히 표시됩니다. 컴포넌트에서 데이터 표현으로 옮기면 같은 패널이 새 분류의 링크를 표시합니다.

<script setup lang="ts">
import {
  UINavigationMenuPopover,
  type UINavigationMenuEntry,
} from "@connextable/ui";

const items: readonly UINavigationMenuEntry[] = [
  { id: "design", label: "디자인 시스템", href: "/" },
  {
    id: "components",
    label: "컴포넌트",
    children: [
      {
        id: "button",
        label: "버튼",
        href: "/components/button",
        description: "작업 실행과 아이콘 버튼",
      },
      {
        id: "input",
        label: "텍스트 입력",
        href: "/components/input",
        description: "한 줄 입력과 상태 표시",
      },
      {
        id: "select",
        label: "선택 목록",
        href: "/components/select",
        description: "정해진 값 중 하나 선택",
      },
    ],
  },
  {
    id: "data",
    label: "데이터 표현",
    children: [
      {
        id: "table",
        label: "데이터 테이블",
        href: "/components/data-table",
        description: "행과 열로 데이터 탐색",
      },
      {
        id: "chart",
        label: "차트",
        href: "/components/chart",
        description: "추세와 분포 시각화",
      },
    ],
  },
  {
    id: "overlays",
    label: "오버레이",
    children: [
      { id: "popover", label: "팝오버", href: "/components/popover" },
      { id: "dialog", label: "다이얼로그", href: "/components/dialog" },
      {
        id: "context",
        label: "컨텍스트 메뉴",
        href: "/components/context-menu",
      },
    ],
  },
];
</script>

<template>
  <UINavigationMenuPopover :items="items" label="문서 탐색" />
</template>

설정과 동작

current에 현재 링크의 id를 지정하면 해당 링크에 aria-current가 적용됩니다.

메뉴 안에서 각 링크의 이름과 간단한 설명을 함께 보여 줍니다.

컴포넌트 패널에서 표와 그리드, 입력 분류의 링크를 나란히 탐색합니다.

items의 icon을 지정해 상위 분류와 패널 안 링크 이름 앞에 아이콘을 표시합니다.

Enter 또는 ↓로 분류의 첫 링크에 들어가고 Tab으로 다음 링크로 이동합니다. Escape를 누르면 분류 버튼으로 돌아갑니다.

가상 그리드는 비활성 상태로 표시합니다. 클릭하거나 Enter를 눌러도 페이지가 열리지 않습니다.

구성 컴포넌트

완성 컴포넌트

UINavigationMenuPopover

items로 직접 이동할 링크와 하위 링크 그룹을 정의합니다. 하위 링크는 팝오버에서 선택하고, 이동은 Nuxt 모듈의 링크 설정을 따릅니다.

직접 이동과 현재 페이지 예제

구조와 배치

UINavigationMenuContent

트리거 또는 현재 값에 연결된 콘텐츠를 담습니다.

UINavigationMenuList

관련 항목을 한 목록으로 묶습니다.

팝업과 위치

UINavigationMenuViewport

스크롤하거나 별도 위치에 표시할 콘텐츠의 영역입니다.

탐색과 동작

UINavigationMenuTrigger

컨트롤을 실행하거나 콘텐츠를 여는 버튼입니다.

UINavigationMenuItem

루트에 등록된 값 하나를 표시하고 상호작용을 연결합니다.

값과 상태 표시

UINavigationMenuIndicator

선택된 값이나 현재 위치를 시각적으로 표시합니다.

주요 API

속성과 모델

v-model:open

팝오버의 열림 상태를 연결합니다.

items[].icon타입Component

이름 앞에 표시할 Vue 아이콘 컴포넌트입니다.

분류와 링크 앞 아이콘 예제
items타입readonly TreeNodeInput<string>[]

각 항목의 id, label과 목적지(href 또는 to), 하위 항목(children)을 지정합니다. icon은 분류나 링크 이름 앞에 표시할 Vue 컴포넌트입니다.

직접 이동과 현재 페이지 예제
current

현재 페이지 링크의 id입니다.

직접 이동과 현재 페이지 예제

슬롯

#label

상위 분류의 entry와 open 상태를 받아 버튼의 이름이나 아이콘을 구성합니다.

전체 속성, 이벤트와 슬롯

UINavigationMenu

disabled-items
readonly string[] | undefined
disabled
boolean | undefined
default-highlighted-value
string | null | undefined
label
string | undefined
text-value
((id: string) => string) | undefined
policies
MenuPolicies<string> | undefined
as
PrimitiveAs | undefined
as-child
boolean | undefined
items필수
readonly TreeNodeInput<string>[]
@update:open
(_value: boolean) => any
@invoke
(_value: string) => any
#default
(props: MenuRootSlotProps) => VNodeChild

UINavigationMenuPopover

items필수
readonly UINavigationMenuEntry[]
label필수
string
current
string | undefined
open
boolean | undefined
@update:open
(value: boolean) => any
#label
(state: { entry: UINavigationMenuEntry; open: boolean; }) => unknown

UINavigationMenuLink

replace
boolean | undefined
disabled
boolean | undefined
external
boolean | undefined
as-child
boolean | undefined
prefetch
boolean | undefined
no-prefetch
boolean | undefined
value필수
string
as
string | Component | undefined
href
string | undefined
icon
Component | undefined
to
string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric | undefined
prefetch-on
PrefetchTrigger | Partial<Record<PrefetchTrigger, boolean>> | undefined
#default
(state: MenuItemSlotProps) => VNodeChild

UINavigationMenuTrigger

as
PrimitiveAs | undefined
as-child
boolean | undefined
disabled
boolean | undefined
value필수
string
#default
(props: MenuItemSlotProps) => VNodeChild

UINavigationMenuContent

as
PrimitiveAs | undefined
as-child
boolean | undefined
for필수
string
#default
(props: MenuRootSlotProps) => VNodeChild

UINavigationMenuList

as-child
boolean | undefined
as
PrimitiveAs | undefined
#default
() => VNodeChild

UINavigationMenuItem

as-child
boolean | undefined
as
PrimitiveAs | undefined
#default
() => VNodeChild

UINavigationMenuViewport

as
PrimitiveAs | undefined
as-child
boolean | undefined
#default
() => VNodeChild

UINavigationMenuIndicator

force-present
boolean | undefined
as
PrimitiveAs | undefined
as-child
boolean | undefined
open
boolean | undefined
#default
(props: { open: boolean; }) => VNodeChild