KAvatar
示例
Sizes & Shapes
SMLSQ
With image fallback
ABAvatar component that displays an image with a text fallback.
Props
| Name | Type | Default | Description |
|---|---|---|---|
| src | string | — | URL of the avatar image. Falls back to text if empty. |
| alt | string | — | Alt text for the avatar image. |
| fallback | string | — | Text 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>