Generates an SVG avatar image based on initials.
| Parameter | Type | Default | Description |
|---|---|---|---|
| name | string | - | The name to generate initials from. |
| size | number | 64 | Size of the image in pixels (clamped between 16 and 512). |
| color | string | #FFFFFF | Text color (hex, rgb, etc.). |
| background | string | #111827 | Background color (hex, rgb, etc.). |
# Basic usage
GET /avatar?name=John+Doe
# Custom colors and size
GET /avatar?name=Alice&size=128&color=000000&background=f0f0f0
A Vue component that renders the avatar directly using SVG.
| Prop | Type | Default | Description |
|---|---|---|---|
| name | string | Required | The name to generate initials from. |
| size | number | 64 | Size of the avatar in pixels. |
| color | string | #FFFFFF | Text color. |
| background | string | #111827 | Background color. |
| fontSize | number | 28 | Font size in pixels. |
| fontWeight | number | 400 | Font weight (e.g. 400, 700). |
| rounded | boolean | true | Whether the avatar should be circular. |
<AvatarInitials name="John Doe" :size="100" background="#3498db" color="#ffffff" :rounded="true" :font-size="40" :font-weight="600" />