PU-Avatar Component
A flexible avatar component with support for images, fallback content, and multiple styling options
Usage
Basic Usage
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
| src | string | No | undefined | Image source URL |
| size | small | medium | large | xlarge | No | medium | Size of the avatar |
| shape | circular | rounded | square | No | circular | Shape of the avatar |
- Base styling with Tailwind:
.avatar { @apply flex items-center justify-center overflow-hidden border-2 border-black; } .avatar img { @apply w-full h-full object-cover; } - Size classes:
.small { @apply w-8 h-8; } .medium { @apply w-12 h-12; } .large { @apply w-16 h-16; } .xlarge { @apply w-24 h-24; } - Shape classes:
.circular { @apply rounded-full; } .rounded { @apply rounded-lg; } .square { @apply rounded-none; }
- Multiple size options
- Customizable shapes
- Fallback content for missing images
- Border styling
- Responsive design
- Tailwind CSS for styling