# Avataaars

- Page: https://jiguang132.com/resources/dicebear/docs/avataaars
- Resource: DiceBear (https://jiguang132.com/resources/dicebear.md)
- All guides: https://jiguang132.com/resources/dicebear/docs.md

Cartoon busts with clothing, hats, hairstyles and facial hair.

## Install

```bash
npm install @dicebear/core@9.4.2 @dicebear/collection@9.4.2
```

## Generate an avatar

The same seed always produces the same avatar, so a user ID or username works as a seed. Avatars are generated locally without a network service.

```ts
import { createAvatar } from '@dicebear/core';
import { avataaars } from '@dicebear/collection';

// “Avataaars” by Pablo Stanley, Free for personal and commercial use
const avatar = createAvatar(avataaars, {
  seed: 'Aria Chen',
  size: 128,
  radius: 50,
});

export const svg = avatar.toString();     // inline SVG markup
export const dataUri = avatar.toDataUri(); // use as an <img> src
```

React component:

```tsx
import { useMemo } from 'react';
import { createAvatar } from '@dicebear/core';
import { avataaars } from '@dicebear/collection';

export function UserAvatar({ seed, size = 64 }: { seed: string; size?: number }) {
  const src = useMemo(() => createAvatar(avataaars, { seed, size }).toDataUri(), [seed, size]);
  return <img src={src} width={size} height={size} alt={`Avatar for ${seed}`} />;
}
```

## Options

Common options: `seed`, `size`, `radius`, `backgroundColor`, `flip`, `rotate`, `scale`.

Style options: `accessories`, `accessoriesColor`, `accessoriesProbability`, `base`, `clothesColor`, `clothing`, `clothingGraphic`, `eyebrows`, `eyes`, `facialHair`, `facialHairColor`, `facialHairProbability`, `hairColor`, `hatColor`, `mouth`, `nose`, `skinColor`, `style`, `top`, `topProbability`.

Full option reference: https://www.dicebear.com/styles/avataaars/

## License and attribution

- Design: Avataaars — Pablo Stanley (https://avataaars.com/)
- License: Free for personal and commercial use (https://avataaars.com/)
- Author-specific license (Free for personal and commercial use): read the terms on the author's page before use.
- The DiceBear software is MIT. Its license does not cover the style artwork. Generated SVGs carry license metadata by default; keep it.

---

Index of all JGuang resources: https://jiguang132.com/llms.txt
