# Pin drop

A pin that goes in like a pin: it falls in point first and lands with a squash, and is plucked out to unpin.

Also called: pin animation, pin chat.

Example: A pin that goes in like a pin. Pin a chat and the pin falls in point first and lands with a squash as the chat glides to the top; unpin and it is plucked out. Preview: https://chatcn.dev/preview/pin-drop-demo

Pin a chat and the pin falls in point first, tilted, lands with a small squash as it goes into the board and fills in. Unpin and it is plucked out, lifting and turning away. While unpinned it waits as a faint outline that only shows on hover or focus.

## Installation

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

## Usage

```tsx
import { PinDrop } from "@/components/ui/chatcn/pin-drop"

<PinDrop label="Fix session expiry" pinned={pinned} onPinnedChange={setPinned} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `pinned` / `onPinnedChange` | `boolean` |  |
| `label` | `string` | For the accessible name: Pin Fix session expiry |

## Accessibility

- A toggle button with `aria-pressed`, named Pin or Unpin and the label.

## Motion

- Keyframed fall and squash, and a lift and turn out. Reduced motion: it fills or empties.

Source: https://chatcn.dev/docs/components/pin-drop