# Avatar (Andromeda Legacy)

Avatar is a component of the free, MIT-licensed Andromeda Legacy design system from AI Canvas (https://aicanvas.me). Index of every system, component and install setup: https://aicanvas.me/llms.txt

Square tile in 3 sizes. Shows an image when src is provided, with a fallback to initials; optional status bar in 4 states.

- Design system: [Andromeda Legacy](https://aicanvas.me/design-systems/andromeda.md)
- License: MIT
- Install slug: `andromeda-avatar`
- Page: https://aicanvas.me/design-systems/andromeda/avatar

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-avatar
```

Needs a free AI Canvas account; signed out, the command writes a placeholder (an `AccountRequired` notice) instead.

Every Andromeda Legacy component at once: `npx shadcn@latest add @aicanvas/andromeda`.

Token setup: the Install section of https://aicanvas.me/llms.txt.

## Use it

It installs to `components/aicanvas/andromeda/components/Avatar.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import { Avatar } from '@/components/aicanvas/andromeda/components/Avatar'
```

## Example

```tsx
import { Avatar } from '@/components/aicanvas/andromeda/components/Avatar'

<Avatar name="Mira Chen" size="md" status="online" />
```

## Variants

- `size`: sm, md or lg (default 'md')
- `status`: online, caution, fault or offline

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name?` | `string` | `'?'` | Used to derive uppercase initials (shown when no src). |
| `src?` | `string` |  | Optional image URL. When provided, renders an img instead of initials. |
| `size?` | `'sm'\|'md'\|'lg'` | `'md'` | One of: sm, md, lg. |
| `status?` | `'online'\|'caution'\|'fault'\|'offline'` |  | When set, renders a status dot. |
| `className?` | `string` |  | Additional CSS classes merged onto the inner avatar box (the outer wrapper receives style and ...props). |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

## More Andromeda Legacy components

- [Badge](https://aicanvas.me/design-systems/andromeda/badge.md)
- [Button](https://aicanvas.me/design-systems/andromeda/button.md)
- [Card](https://aicanvas.me/design-systems/andromeda/card.md)
- [Checkbox](https://aicanvas.me/design-systems/andromeda/checkbox.md)
- [Corner Markers](https://aicanvas.me/design-systems/andromeda/corner-markers.md)
