Documentation

API Route: /avatar

Generates an SVG avatar image based on initials.

Query Parameters

ParameterTypeDefaultDescription
namestring-The name to generate initials from.
sizenumber64Size of the image in pixels (clamped between 16 and 512).
colorstring#FFFFFFText color (hex, rgb, etc.).
backgroundstring#111827Background color (hex, rgb, etc.).

Examples

# Basic usage

GET /avatar?name=John+Doe

# Custom colors and size

GET /avatar?name=Alice&size=128&color=000000&background=f0f0f0

Component: <AvatarInitials />

A Vue component that renders the avatar directly using SVG.

Props

PropTypeDefaultDescription
namestringRequiredThe name to generate initials from.
sizenumber64Size of the avatar in pixels.
colorstring#FFFFFFText color.
backgroundstring#111827Background color.
fontSizenumber28Font size in pixels.
fontWeightnumber400Font weight (e.g. 400, 700).
roundedbooleantrueWhether the avatar should be circular.

Usage Example

<AvatarInitials
  name="John Doe"
  :size="100"
  background="#3498db"
  color="#ffffff"
  :rounded="true"
  :font-size="40"
  :font-weight="600"
/>