# Queue

> Queue position and rate-limit countdown states.

## Install

```bash
npx shadcn@latest add https://crate.onerollstudios.com/r/queue.json
```

## Import

```tsx
import { Queue } from "@/components/agent-wait-states/queue";
```

## Props

| Prop | Type | Required | Default | Notes |
| --- | --- | --- | --- | --- |
| `className` | `string` | no |  |  |
| `accent` | `boolean` | no | `false` |  |
| `labels` | `Partial<CrateLabels>` | no |  | Replace any of this component's labels. Overrides CrateProvider. |
| `variant` | `"line" \| "rate-limit"` | no | `"line"` |  |
| `position` | `number` | no |  |  |
| `retryIn` | `number` | no |  |  |

## States

Queue shows a different state for each value of `variant`:

- `variant`: `line`, `rate-limit`

## Labels

Override with the `labels` prop or a `CrateProvider`.

| Label | English default |
| --- | --- |
| `queueWaiting` | `"Waiting in line…"` |
| `queuePosition` | `` (position, f) => `You’re #${f.number(position)} in line` `` |
| `rateLimitedUnknown` | `"Slow down. Try again shortly."` |
| `rateLimited` | `` (seconds, f) => `Slow down. Try again in ${f.seconds(seconds)}` `` |

## Example

```tsx
<Queue position={3} accent />
<Queue variant="rate-limit" retryIn={20} accent />
```
