avatar

Avatar with badge icon

Avatar with badge icon

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

src/avatar/c-avatar-7.vue

<script setup lang="ts">
import { Avatar, AvatarBadge, AvatarFallback, AvatarImage } from "@/components/ui/avatar"

const PIXEL =
  "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAUwAOw=="
</script>

<template>
  <div class="flex items-center gap-2">
    <Avatar class="relative">
      <AvatarImage :src="PIXEL" alt="Nick Johnson" />
      <AvatarFallback>NJ</AvatarFallback>
      <AvatarBadge>
        <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"
          class="lucide lucide-plus"
          aria-hidden="true"
        ><path d="M5 12h14" /><path d="M12 5v14" /></svg>
      </AvatarBadge>
    </Avatar>
    <Avatar class="relative">
      <AvatarImage :src="PIXEL" alt="Alex Johnson (away)" />
      <AvatarFallback>AJ</AvatarFallback>
      <AvatarBadge class="bg-success">
        <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"
          class="lucide lucide-check"
          aria-hidden="true"
        ><path d="M20 6 9 17l-5-5" /></svg>
      </AvatarBadge>
    </Avatar>
    <Avatar class="relative">
      <AvatarImage :src="PIXEL" alt="Sarah Chen" />
      <AvatarFallback>SC</AvatarFallback>
      <AvatarBadge class="bg-warning">
        <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"
          class="lucide lucide-star"
          aria-hidden="true"
        ><path d="M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z" /></svg>
      </AvatarBadge>
    </Avatar>
    <Avatar class="relative">
      <AvatarImage :src="PIXEL" alt="Michael Rodriguez" />
      <AvatarFallback>MR</AvatarFallback>
      <AvatarBadge class="bg-info">
        <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"
          class="lucide lucide-shield-check"
          aria-hidden="true"
        ><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" /><path d="m9 12 2 2 4-4" /></svg>
      </AvatarBadge>
    </Avatar>
  </div>
</template>

Установка

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

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

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