InitialsAvatar

<InitialsAvatar> renders one or two initials on a solid background — perfect for fallback profile pictures.

Usage

<script setup>
import { InitialsAvatar } from '@maxnth/gestalt'
</script>

<template>
  <InitialsAvatar seed="Maximilian Nöth" :size="96" mode="double" />
</template>

Double initials split the seed by spaces, dashes, underscores, and dots, so Ada Lovelace becomes AL.

Props

PropTypeDefaultDescription
seedstring | numberThe name or value used to derive the initials.
sizenumber32Rendered size in pixels.
radiusnumber | string"9999px"Corner radius. Number is pixels; string is CSS.
mode"single" | "double""single"Whether to show one or two initials.
backgroundstring#RGB or #RRGGBB; invalid values use the generated color.
colorstring#RGB or #RRGGBB; invalid values use automatic contrast.
fontFamilystringFont family for the initials.
ringboolean | number | stringfalseOptional outline. true = white 2px ring.
styleobjectExtra inline styles merged onto the wrapper.

Examples

<InitialsAvatar seed="Jane Doe" :size="96" mode="single" ring />

<InitialsAvatar seed="Jane Doe" :size="96" mode="double" ring />

<InitialsAvatar seed="Ada Lovelace" :size="96" mode="double" background="#1e293b" color="#38bdf8" ring />