# User Card (Andromeda Legacy)

User Card 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

Wider user trigger that shows avatar, name, and role alongside the chevron, the canonical bottom-of-sidebar identity card. Same popover as User Menu, with menu rows supplied by the caller via an `items` prop; opens upward by default and stretches to the card width.

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

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-user-card
```

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/UserCard.tsx` (under `src/` if your project has one). With the usual `@/` alias:

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

## Example

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

<UserCard
  name="Mira Chen"
  role="Release manager"
  status="online"
  items={[{ id: 'profile', label: 'Profile' }, { id: 'signout', label: 'Sign out' }]}
/>
```

## Variants

- `status`: online, caution, fault or offline
- `avatarSize`: sm, md or lg (default 'md')
- `placement`: top or bottom (default 'top')
- `align`: start, end or stretch (default 'stretch')

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` |  | Shown as the card's primary label and used for the avatar initials. |
| `role?` | `string` |  | Subtitle under the name (e.g. "Flight Director"). |
| `src?` | `string` |  | Optional avatar image URL; falls back to initials when absent. |
| `status?` | `'online'\|'caution'\|'fault'\|'offline'` |  | Presence status shown as a dot on the avatar. Passed verbatim to Avatar, whose enum this is; any other value renders no dot. |
| `avatarSize?` | `'sm'\|'md'\|'lg'` | `'md'` | Size of the avatar shown in the card. |
| `items` | `UserMenuItem[]` |  | Entries rendered in the popover menu. |
| `placement?` | `'top'\|'bottom'` | `'top'` | Which side of the card the menu opens toward. |
| `align?` | `'start'\|'end'\|'stretch'` | `'stretch'` | How the panel aligns to the card; stretch matches its width. |
| `defaultOpen?` | `boolean` | `false` | Render the menu pre-opened (showcases / docs). Outside-click and Escape still dismiss it. |
| `staticOpen?` | `boolean` | `false` | Render pre-opened AND pinned; outside-click / Escape do not dismiss it. For showcases / docs where several popovers are shown open at once and one must not close the others. |
| `ariaLabel?` | `string` | `'User menu'` | Accessible label for the trigger button and menu. |
| `className?` | `string` |  | Extra class names for the card's root element. |
| `style?` | `React.CSSProperties` |  | Inline styles merged onto the card's root element. |

## More Andromeda Legacy components

- [User Menu](https://aicanvas.me/design-systems/andromeda/user-menu.md)
- [Alert](https://aicanvas.me/design-systems/andromeda/alert.md)
- [Avatar](https://aicanvas.me/design-systems/andromeda/avatar.md)
- [Badge](https://aicanvas.me/design-systems/andromeda/badge.md)
- [Button](https://aicanvas.me/design-systems/andromeda/button.md)
