# Quote Builder

> A quote or proposal: line items with quantity, unit, unit price and discount, optional extras the customer ticks on, and the subtotal, discounts, VAT and total worked out as you type.

Component · CRM · Halo kit · [Live page](https://ui.twentyfirst.media/halo/components/QuoteBuilder/)

A quote or proposal: line items with quantity, unit, unit price and discount, optional extras the
customer ticks on, and the subtotal, discounts, VAT and total worked out as you type.

- `onChange(lines)` makes quantity, price and discount editable and optional lines tickable;
  without it the quote is read only. `onAdd` and `onRemove` add and remove lines.
- `taxRate` in percent adds the VAT row. Money goes through `Intl` in `currency`.
- Optional lines that are not ticked stay visible but are struck through and not counted.

## Example

```tsx
import * as React from "react";
import { Panel, QuoteBuilder } from "@twentyfirstmedia/halo";
import { LINES } from "./_sales";

export default function Preview() {
  const [lines, setLines] = React.useState(LINES);
  return (
    <Panel title="Quote Q-2026-118" subtitle="Website relaunch · Nordhafen Outdoor">
      <QuoteBuilder
        lines={lines}
        taxRate={19}
        onChange={setLines}
        onRemove={(id) => setLines((all) => all.filter((l) => l.id !== id))}
        onAdd={() =>
          setLines((all) => [
            ...all,
            { id: String(Date.now()), name: "New item", quantity: 1, unitPrice: 0 },
          ])
        }
      />
    </Panel>
  );
}
```

## Props

### QuoteBuilder

| Prop | Type | Notes |
| --- | --- | --- |
| `lines` | `QuoteLine[]` | Required |
| `onChange?` | `(lines: QuoteLine[]) => void` | Makes quantity, price and discount editable and optional lines tickable. |
| `onAdd?` | `() => void` | Shows "Add line". |
| `onRemove?` | `(id: string) => void` | Shows a remove button per line. |
| `currency?` | `string` |  |
| `taxRate?` | `number` | VAT or sales tax in percent (e.g. 19); no tax row when unset. |
| `label?` | `string` | Accessible name (default "Quote"). |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |

### Panel

| Prop | Type | Notes |
| --- | --- | --- |
| `side?` | `boolean` |  |
| `title?` | `string` |  |
| `subtitle?` | `string` |  |
| `action?` | `ReactNode` |  |
| `children?` | `ReactNode` |  |
| `surface?` | `Surface` | `"glass"`: translucent glass over what is behind (maps, 3D, video, photos); `"solid"` opts out inside a glass `UIProvider`. |
| `className?` | `string` | Extra class on the root element. |
| `style?` | `CSSProperties` | Inline style on the root element. |
