navigation-menu

Navigation menu with grid layout.

Navigation menu with grid layout.

Загрузка превью…

src/navigation-menu/c-navigation-menu-2.vue

<script setup lang="ts">
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger } from "@/components/ui/navigation-menu"

const components = [
  {
    title: "Alert Dialog",
    href: "#",
    description: "A modal dialog that interrupts the user with important content.",
  },
  {
    title: "Hover Card",
    href: "#",
    description: "For sighted users to preview content available behind a link.",
  },
  {
    title: "Progress",
    href: "#",
    description: "Displays an indicator showing the completion progress of a task.",
  },
  {
    title: "Scroll-area",
    href: "#",
    description: "Visually or semantically separates content.",
  },
]
</script>

<template>
  <div class="flex items-center justify-center">
    <NavigationMenu>
      <NavigationMenuList>
        <NavigationMenuItem>
          <NavigationMenuTrigger>Components</NavigationMenuTrigger>
          <NavigationMenuContent>
            <ul class="grid w-[400px] gap-2 md:w-[500px] md:grid-cols-2">
              <li v-for="component in components" :key="component.title">
                <NavigationMenuLink as-child class="flex flex-col items-start gap-2 p-3">
                  <a :href="component.href">
                    <div class="text-sm leading-none font-medium">{{ component.title }}</div>
                    <p class="text-muted-foreground line-clamp-2 text-sm leading-snug">
                      {{ component.description }}
                    </p>
                  </a>
                </NavigationMenuLink>
              </li>
            </ul>
          </NavigationMenuContent>
        </NavigationMenuItem>
      </NavigationMenuList>
    </NavigationMenu>
  </div>
</template>

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-navigation-menu-2.json

Зависимости реестра

Источник: порт из ReUI (Keenthemes, MIT)