Skip to content

KAvatar

示例

Sizes & Shapes

SMLSQ

With image fallback

AB

Avatar component that displays an image with a text fallback.

Props

NameTypeDefaultDescription
srcstringURL of the avatar image. Falls back to text if empty.
altstringAlt text for the avatar image.
fallbackstringText to display when no image is provided.
size'sm' | 'default' | 'lg''default'Size of the avatar.
shape'circle' | 'square''circle'Shape of the avatar.

Basic Usage

vue
<script setup>
import { KAvatar } from '@kK-2004/ui-component'
</script>

<template>
  <KAvatar src="/avatar.png" alt="User" fallback="U" size="default" shape="circle" />
</template>