# Icon Button (Andromeda Legacy)

Icon Button 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 label-less companion to Button. Same variant + size vocabulary so it lines up with Button on the same baseline.

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

## Install

```bash
npx shadcn@latest add @aicanvas/andromeda-icon-button
```

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

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

## Example

```tsx
import { IconButton } from '@/components/aicanvas/andromeda/components/IconButton'
import { Gear } from '@/components/icons/gear'

<IconButton icon={Gear} aria-label="Deployment settings" variant="ghost" />
```

## Variants

- `variant`: default, outline, ghost or destructive (default 'outline')
- `size`: sm, md or lg (default 'md')

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant?` | `'default'\|'outline'\|'ghost'\|'destructive'` | `'outline'` | One of: default, outline, ghost, destructive. |
| `size?` | `'sm'\|'md'\|'lg'` | `'md'` | One of: sm, md, lg. |
| `icon?` | `React.ComponentType<IconProps>` |  | Icon component. Pass either `icon` OR `children` for custom glyphs. |
| `children?` | `React.ReactNode` |  | Custom icon content (SVG, bars, etc.) |
| `aria-label?` | `string` |  | Required for accessibility (no visible text). |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |
| `type?` | `'button'\|'submit'\|'reset'` | `'button'` | HTML button type; defaults to 'button' so the control does not submit an enclosing form. |
| `disabled?` | `boolean` |  | When true, disables the control. |
| `onClick?` | `(e: React.MouseEvent<HTMLButtonElement>) => void` |  | Handler called when the element is clicked. |

## More Andromeda Legacy components

- [Input](https://aicanvas.me/design-systems/andromeda/input.md)
- [Metric Chart](https://aicanvas.me/design-systems/andromeda/metric-chart.md)
- [Waveform](https://aicanvas.me/design-systems/andromeda/waveform.md)
- [Media Card](https://aicanvas.me/design-systems/andromeda/media-card.md)
- [Data Table](https://aicanvas.me/design-systems/andromeda/data-table.md)
