# Plan Upgrade block

> Four-step billing upgrade wizard with live invoice preview sidebar and due-today total

Plan, seats, payment, and review flow that recalculates seat subtotal, annual discount, and support fee into a draft invoice. Uses ReUI Stepper, Badge, Alert plus Card, RadioGroup, Slider, Select, and Calendar. For checkout and seat upgrade screens.

- Type: Pro block
- Category: [Wizard](https://web.dev.reui.io/blocks/application/wizard.md)
- Page: https://web.dev.reui.io/blocks/application/wizard/wizard-4
- Docs (Base UI): https://web.dev.reui.io/docs/components/base/stepper.md
- Docs (Radix UI): https://web.dev.reui.io/docs/components/radix/stepper.md
- MCP: `get_block("wizard-4")`
- Built with: Alert, Badge, Button, Calendar, Card, Field, Input, Item, Popover, Radio Group, Select, Slider, Stepper, Tooltip
- Installs with a ReUI Pro or Ultimate license; setup: https://web.dev.reui.io/docs/license-setup

## Best for

Plan radio cards and a seat slider beside an invoice preview shown on every step, whose due today total follows plan, seats and cycle

## Agent notes

- `PLAN_OPTIONS`, `SUPPORT_FEES` and `ANNUAL_DISCOUNT_RATE` set every price; `dueToday` is computed in the component with no tax or proration
- `handlePrimaryAction` on the last step only sets `isIssued`; there is no API call or toast, so post the draft invoice there
- `BillingSeatSlider` runs from `currentSeats` to `MAX_BILLING_SEATS`; set both from the real subscription

## When not to use

- A plan change that must show prorated charges and credits: use [Plan Change](https://web.dev.reui.io/blocks/solutions/billing/solution-billing-8.md) (`get_block("solution-billing-8")`)
- Itemized invoice lines with per row tax sent to a customer: use [Send Invoice](https://web.dev.reui.io/blocks/application/wizard/wizard-3.md) (`get_block("wizard-3")`)

## Third-party libraries

- date-fns v4: [docs](https://date-fns.org/v4.1.0/docs/Getting-Started)
- React DayPicker v9: [API reference](https://daypicker.dev/v9/api), [docs](https://daypicker.dev/v9/start), through shadcn Calendar

## Install

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

## About Wizard blocks

### When to use

- Money tasks done in steps: account billing setup, sending an invoice, a seat upgrade or a fund transfer
- Admin intake in steps: a vendor compliance file, a store product with variants or a batch of team invites
- A long form split into 3 to 5 numbered steps with previous and next buttons and a summary before submit

### When not to use

- A first run setup right after signup that collects a profile, a role and goals: use the [Onboarding blocks](https://web.dev.reui.io/blocks/application/onboarding.md)
- Only numbered step markers and panel switching around fields you already built: use [Stepper](https://web.dev.reui.io/components/stepper.md) (`get_component("stepper")`)
- A shopper paying for a cart, entering shipping and card details beside an order summary: use the [Checkout blocks](https://web.dev.reui.io/blocks/ecommerce/checkout.md)

### Agent notes

- Steps come from `WIZARD_STEPS`, `PRODUCT_STEPS` or `PAYMENT_STEPS` in the data file, and each step id has its own render branch; add both for a new step
- No step calls an API: the final button shows a sonner `toast`, sets local state such as `isIssued`, or both; post the collected values from that handler
- Each page.tsx sets a `min-h-svh` wrapper and the full screen variants size their root to the viewport too; remove both inside an app shell or dialog

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.
