# Tooltip (Andromeda Legacy)

Tooltip 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

Hover label for icon-only controls. Wraps any child, floats above or below, sharp corners, mono uppercase text. Shows on keyboard focus too, carries role="tooltip", and clamps itself away from the viewport edges.

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

## Install

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

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

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

## Example

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

<Tooltip label="Copy invoice number" position="top">
  <button type="button">INV-2048</button>
</Tooltip>
```

## Variants

- `position`: top or bottom (default 'top')

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | `React.ReactNode` |  | Content shown in the tooltip. |
| `position?` | `'top'\|'bottom'` | `'top'` | One of: top, bottom. |
| `portal?` | `boolean` | `false` | Render the label into <body> instead of the trigger. |
| `children` | `React.ReactNode` |  | The trigger element. |
| `className?` | `string` |  | Additional CSS classes applied to the root element. |
| `style?` | `React.CSSProperties` |  | Inline styles applied to the root element. |

## More Andromeda Legacy components

- [Trend Chart](https://aicanvas.me/design-systems/andromeda/trend-chart.md)
- [User Card](https://aicanvas.me/design-systems/andromeda/user-card.md)
- [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)
