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 barWhen 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
| Prop | Type | Required | Description |
|---|---|---|---|
items | LineItem[] | — | |
currency | string | — | |
taxLabel | string | — | "VAT", "GST", "Sales tax"… |
onChange | (index: number, patch: Partial<LineItem>) => void | — | |
onAddItem | () => void | — | |
onRemoveItem | (index: number) => void | — | |
discount | DocumentDiscount | — | Applied before tax and apportioned across lines. |
shipping | number | — | Minor units. |
note | React.ReactNode | — | |
isReadOnly | boolean | — | |
className | string | — |