Installation
Install the component
templui add avatarAdd the JavaScript to your layout
@avatar.Script()Call this template in your base layout file (e.g., in the <head> section).
Examples
Fallback
JDSizes
With Icon
Group
API Reference
Avatar
Root container for avatar component. Default size is 8 (size-8). Use the Class prop to customize size and styling.
| Name | Type | Default |
|---|---|---|
Unique identifier for the avatar element. | | - |
Additional CSS classes to apply to the avatar. Use this to set custom sizes (e.g. 'size-12', 'size-16') or other styles. | | - |
Additional HTML attributes to apply to the avatar element. | | - |
Image
Image element within the avatar that displays the user's photo.
| Name | Type | Default |
|---|---|---|
Unique identifier for the image element. | | - |
Additional CSS classes to apply to the image. | | - |
Additional HTML attributes to apply to the image element. | | - |
Image source URL. | | - |
Alternative text for the image. | | - |
Fallback
Fallback element displayed when the image fails to load, typically showing initials or an icon.
| Name | Type | Default |
|---|---|---|
Unique identifier for the fallback element. | | - |
Additional CSS classes to apply to the fallback. | | - |
Additional HTML attributes to apply to the fallback element. | | - |