Billing Purchase Order Form
A form for enterprise customers to submit purchase order details for manual invoicing, covering the PO number, company name, billing contact email, an optional tax or VAT ID, and free-form notes. Validates the required fields on submit and swaps to a confirmation view once the PO is on file.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its input, label, textarea, button dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/billing-purchase-order-form.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing105.tsx instead.
Usage
The file also exports billing105Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Billing105, billing105Demo } from "@/components/blocks/billing/billing105"; export default function Page() { return <Billing105 {...billing105Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| heading | string | "Purchase order details" | Heading above the form. |
| description | string | "Used to match invoices to your internal PO for manual billing." | Supporting sentence under the heading. |
| defaultValues | Partial<PurchaseOrderValues> | none | Initial field values. Any field left out starts blank. |
| submitLabel | string | "Submit purchase order" | Label on the submit button. |
| className | string | none | Extra classes for the outer card. |
Types
interface PurchaseOrderValues { poNumber: string; companyName: string; billingEmail: string; taxId: string; notes: string; }
Behavior notes
- On submit, poNumber, companyName, and billingEmail are required; taxId and notes are optional and never block submission.
- billingEmail is checked against a simple email-shaped regex, not a full RFC 5322 validator, so obviously malformed addresses get caught without rejecting valid edge cases.
- A valid submit sets a submitting state for 700ms before switching to a confirmation view, standing in for a real save request. Replace the setTimeout in handleSubmit with your actual API call.
- Editing any field after a failed submit clears that field's error and resets the status back to idle, so the user isn't stuck looking at a stale error.
- The confirmation view includes a "Submit another" button that resets status back to idle without clearing the fields, so it's easy to file a second PO for a related purchase.
Frequently asked questions
More Billing Blocks
View all →Billing Invoice List
Invoice history table with status badges, formatted amounts, and a per-row download link, built with shadcn/ui and Tailwind CSS.
Billing Failed Payment Alert
High-contrast failed-payment alert with a message, a retry button, and an optional update-payment-method button, built with shadcn/ui and Tailwind CSS.
Billing Credit Balance
Compact credit balance card with a large total, an optional purchased-versus-promotional breakdown, a low-balance notice, and a top-up button.
Billing Payment Methods
A saved payment method list for React and Next.js with brand icons, a default badge, near-expiry warnings, and remove/set-default actions per row.
Billing Add Card
A card entry form for React and Next.js with auto-formatted fields, internal brand detection, and per-field validation feedback built with shadcn/ui and Tailwind CSS.
Billing Coupon Code
An inline promo code input for React and Next.js with a simulated loading state, an applied summary showing the discount amount, and an invalid-code message.