# Resource Capacity block

> Capacity-aware resource gantt with booking cards, drag guardrails, and full CRUD

Capacity aware resource gantt with booking cards, drag guardrails and full CRUD

- Type: Pro block
- Category: [Gantt](https://web.dev.reui.io/blocks/application/gantt.md)
- Page: https://web.dev.reui.io/blocks/application/gantt/gantt-4
- Docs (Base UI): https://web.dev.reui.io/docs/components/base/gantt.md
- Docs (Radix UI): https://web.dev.reui.io/docs/components/radix/gantt.md
- MCP: `get_block("gantt-4")`
- Built with: Alert, Alert Dialog, Avatar, Badge, Button, Card, Checkbox, Context Menu, Dropdown Menu, Empty, Field, Gantt, Input, Label, Popover, Scroll Area, Select, Sheet, Textarea, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

Bookings that each take a percent of someone's week, where a drag or resize past capacity is refused, with workstream and squad filters

## Agent notes

- Replace `PEOPLE`, `SQUADS` and `BOOKINGS` in data.ts; each booking's `startOffset` and `endOffset` count days from `ANCHOR_DATE`
- `saveSheet` and `duplicateBooking` never call `wouldOverbook`, so only a drag or resize is refused and a form save can overbook a person
- `cancelBooking` from the bar menu and `clearRow` from the row menu remove bookings with no confirm dialog, unlike the sheet

## When not to use

- Tasks nested under lists, with owners, statuses and dependency arrows: use [Project Timeline](https://web.dev.reui.io/blocks/application/gantt/gantt-1.md) (`get_block("gantt-1")`)
- Timed visits within a single day, where a technician may be double booked: use [Technician Dispatch](https://web.dev.reui.io/blocks/application/gantt/gantt-2.md) (`get_block("gantt-2")`)

## Third-party libraries

- date-fns v4: [docs](https://date-fns.org/v4.1.0/docs/Getting-Started)
- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/gantt-4
```

## About Gantt blocks

### When to use

- A full page planner whose rows of tasks, people or stages own bars that are dragged, resized and edited
- Schedules that check a rule on every drop: a locked bar, opening hours, upstream order or capacity
- Project roadmaps, one day field dispatch, agent run boards and team capacity plans

### When not to use

- Only the scheduling primitive, to wire into your own layout with no demo rules: use [Gantt](https://web.dev.reui.io/components/gantt.md) (`get_component("gantt")`)
- Deals re-dated on bars beside table, board and calendar views of the same records: use the [CRM blocks](https://web.dev.reui.io/blocks/solutions/crm.md)
- A feed of past activity or milestones that people read rather than reschedule: use the [Timeline blocks](https://web.dev.reui.io/blocks/application/timeline.md)

### Agent notes

- Each block wraps its `Card` in an `h-svh` page with `p-4` padding; remove that wrapper when the board sits inside an app shell
- Every block opens on a fixed 2026 demo day passed to `defaultDate` and builds its bars around it; swap both for today and your records
- Refused drops and saved changes call `toast` from `sonner`, and no block mounts a Toaster; render one in your app or those messages never appear

Every ReUI item has a twin like this one; the index is https://web.dev.reui.io/llms.txt. Agents with the ReUI MCP (https://web.dev.reui.io/docs/mcp) get the same guidance from the getters named above.
