dropdown-menu

Notifications dropdown with items

Notifications dropdown with items

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

src/dropdown-menu/c-dropdown-menu-17.vue

<!--
  Расхождение с апстримом: `IconPlaceholder` заменена инлайновым `<svg>`
  (lucide-react v0.545.0 "bell"/"check") — см. docs/PORTING.md §5.
-->
<script setup lang="ts">
import { Button } from "@/components/ui/button"
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"
</script>

<template>
  <DropdownMenu>
    <DropdownMenuTrigger as-child>
      <Button variant="ghost" size="icon" aria-label="Notifications">
        <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="lucide lucide-bell">
          <path d="M10.268 21a2 2 0 0 0 3.464 0" />
          <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />
        </svg>
      </Button>
    </DropdownMenuTrigger>
    <DropdownMenuContent align="start" class="w-56">
      <DropdownMenuGroup>
        <DropdownMenuLabel>Notifications</DropdownMenuLabel>
        <DropdownMenuItem>
          <span class="flex-1">New message from Alex</span>
          <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="lucide lucide-check">
            <path d="M20 6 9 17l-5-5" />
          </svg>
        </DropdownMenuItem>
        <DropdownMenuItem>
          <span class="flex-1">Document approved</span>
        </DropdownMenuItem>
        <DropdownMenuItem>
          <span class="flex-1">Pipeline stage updated</span>
        </DropdownMenuItem>
      </DropdownMenuGroup>
    </DropdownMenuContent>
  </DropdownMenu>
</template>

Установка

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

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

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