Tally UI

PriceForm

Line price entry with the current price and an optional reason

Import

import { PriceForm } from '@tallyui/components';

Usage

<PriceForm
  lineName={line.name}
  currency={sale.order.currency}
  currentMinor={line.unitPriceMinor}
  onApply={(amountMinor, reason) => applyPrice(amountMinor, reason)}
  onClose={() => setPriceOpen(false)}
/>

Renders the line's current price, a new price input, an optional reason, and Apply and Cancel buttons. Prices are parsed into minor units, including zero; parsing errors and application refusals appear inline.

Props

PropTypeDefaultDescription
lineNamestringrequiredLine name used in the heading and accessible group label
currencystringrequiredCurrency used to format the current price and parse the new amount
currentMinornumberrequiredCurrent price in minor units, displayed above the input
onApply(amountMinor: number, reason?: string) => string | nullrequiredReceives the parsed price and trimmed reason, or undefined for an empty reason; return a refusal or null once applied
onClose() => voidrequiredCalled on Cancel or after onApply returns null

On this page