# Attach bloom

The composer's plus, opening like a flower: it turns into a cross and the menu blooms out of the button as a growing circle.

Also called: attach menu animation, radial plus menu.

Example: A plus that blooms. The composer's plus turns into a cross and its menu blooms out of the button, options rising into it one after another. Preview: https://chatcn.dev/preview/attach-bloom-demo

The plus turns a quarter into a cross and the menu blooms out of the button itself: its surface grows as a circle centred on the plus until it covers the menu, and the options rise into it one after another, nearest the button first. Closing runs the bloom back into the button, faster.

## Installation

```bash
npx shadcn@latest add https://chatcn.dev/r/attach-bloom.json
```

## Usage

```tsx
import { AttachBloom } from "@/components/ui/chatcn/attach-bloom"

<AttachBloom
  items={[
    { id: "upload", label: "Upload files", icon: <UploadIcon />, hint: "Up to 10", onSelect: pickFiles },
    { id: "photo", label: "Take a photo", icon: <CameraIcon />, onSelect: openCamera },
  ]}
/>
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `items` | `{ id, label, icon?, hint?, onSelect?, disabled? }[]` |  |
| `label` | `string` | Trigger name. Default "Add files and more" |
| `side` | `"top" | "bottom"` | Which way it opens. Default `top` |
| `open` / `defaultOpen` | `boolean` | Controlled or uncontrolled |
| `onOpenChange` | `(open: boolean) => void` |  |

## Keyboard

| Key | Action |
| --- | --- |
| `ArrowUp` / `ArrowDown` on the plus | Open |
| `ArrowUp` / `ArrowDown` | Move between options |
| `Home` / `End` | First or last option |
| `Enter` / `Space` | Pick |
| `Escape` | Close and return focus to the plus |
| `Tab` | Close |

## Accessibility

- The trigger has `aria-haspopup="menu"` and `aria-expanded`; options are `menuitem`s.
- Pressing outside closes it.

## Motion

- The bloom is a `clip-path` circle from the plus, 300 ms in, 200 ms out. Options rise 8 px with a 2 px blur, 35 ms apart.
- The start of the bloom is also set inline, so the menu never paints fully open for a frame first.
- Reduced motion: a short fade.

Source: https://chatcn.dev/docs/components/attach-bloom