Skip to main content

LineItemEditor

Quantity × price → discount → tax → totals. Totals are ALWAYS derived — there is deliberately no subtotal or total prop.

Signature
Density
Viewport
Theme and light/dark are set in the top bar
Live demo
Open ↗

When to use​

Quantity × price → discount → tax → totals.

Accessibility​

Fully keyboard operable: Tab to focus, Enter/Space to activate. The visible focus ring uses --focus-ring — never remove it. Provide an accessible label (aria-label) for icon-only controls.

Install and import​

npx shadcn@latest add @prism/line-item-editor
import { LineItemEditor } from '@/components/prism/LineItemEditor';

In a no-build prototype, read it from the bundle instead: const { LineItemEditor } = window.PrismDesignSystem_39d121;

Props​

PropTypeRequiredDescription
itemsLineItem[]—
currencystring—
taxLabelstring—"VAT", "GST", "Sales tax"…
onChange(index: number, patch: Partial<LineItem>) => void—
onAddItem() => void—
onRemoveItem(index: number) => void—
discountDocumentDiscount—Applied before tax and apportioned across lines.
shippingnumber—Minor units.
noteReact.ReactNode—
isReadOnlyboolean—
classNamestring—