The package renders SVG markup synchronously. It has no raster encoder: PNG and WebP are provided by the HTTP API.
Installation
Import to render SVG avatars directly as React JSX elements.
Use exported runtime object constants ( , , ) for clean dot-notation autocompletion. They are values, not functions, so they do not return anything. AvatarOutputFormat applies only to package output: SVG or JSON.
TypeScript types such as AvatarProps, CreateAvatarOptions, AvatarColors, AvatarJson, and AvatarDetails only exist during type checking and will not be compiled into your bundle.
generates deterministic avatar output. Set (default) to return an SVG string, or to return a structured JSON object with dataURIs.
turns a variant or family into one concrete variant. Use to list the variants belonging to a specific family.
resolveVariant(value)Resolves a concrete variant or a deterministic variant from a family.getFamilyVariants(family)Lists the concrete variants in one family; an unknown family gives an empty list.Metadata functions expose the catalog and capabilities without duplicating constants.
getAvatarDetails(variant)Returns one capability record; an unknown variant returns undefined.getAllAvatarDetails()Returns detached capability records for every variant.Verify if a variant supports animation for a particular effect dynamically.
isAnimateActive(variant, effect)True only when animation can run for that variant and effect combination.