button

Button with an unread badge

Button with an unread badge

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

src/button/c-button-39.vue

<script setup lang="ts">
import { Badge } from "@/components/reui/badge"
import { Button } from "@/components/ui/button"
</script>

<template>
  <Button
    variant="outline"
    class="relative gap-2"
    aria-label="Inbox (8 unread)"
  >
    <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-mail"
    >
      <path d="m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7" />
      <rect x="2" y="4" width="20" height="16" rx="2" />
    </svg>
    Inbox
    <Badge
      variant="destructive"
      size="sm"
      class="absolute -top-1.5 -right-2 rounded-full px-1"
      aria-hidden="true"
    >
      8
    </Badge>
  </Button>
</template>

Установка

npx shadcn-vue@latest add https://revueui.rootapi.dev/r/c-button-39.json

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

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