# Micah 插画 · Micah

- 页面: https://jiguang132.com/zh/resources/dicebear/docs/micah
- 资源: DiceBear (https://jiguang132.com/zh/resources/dicebear.md)
- 全部指南: https://jiguang132.com/zh/resources/dicebear/docs.md

头像插画体系，可组合上衣、耳饰和胡须。

## 安装

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

## 生成头像

同一个种子（seed）总是生成同一个头像，适合用用户 ID 或用户名作为种子。头像在本地生成，不需要请求网络服务。

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

// “Avatar Illustration System” by Micah Lanier, CC BY 4.0 — credit the author where the avatar is used.
const avatar = createAvatar(micah, {
  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 组件：

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

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

## 选项

通用选项: `seed`, `size`, `radius`, `backgroundColor`, `flip`, `rotate`, `scale`.

此风格专有选项: `base`, `baseColor`, `earringColor`, `earrings`, `earringsProbability`, `ears`, `eyeShadowColor`, `eyebrows`, `eyebrowsColor`, `eyes`, `eyesColor`, `facialHair`, `facialHairColor`, `facialHairProbability`, `glasses`, `glassesColor`, `glassesProbability`, `hair`, `hairColor`, `hairProbability`, `mouth`, `mouthColor`, `nose`, `shirt`, `shirtColor`.

完整选项说明见 https://www.dicebear.com/styles/micah/

## 许可与署名

- 设计: Avatar Illustration System — Micah Lanier (https://www.figma.com/community/file/829741575478342595)
- 许可: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
- CC BY 4.0：使用时须注明作者和许可，例如：“Avatar Illustration System” by Micah Lanier, CC BY 4.0。
- DiceBear 软件本身为 MIT 许可；软件许可不覆盖风格作品。生成的 SVG 默认带有许可元数据，请保留。

---

JGuang 全部资源索引: https://jiguang132.com/llms.txt
