Quote Lock

Quote Lock is a copy-paste React component that stops helps prevent paying a re-quoted price nobody saw before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/quote-lock
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 3 extra npm packages
  • A11y guidance in docs

StopsHelps prevent paying a re-quoted price nobody saw

Was this component page useful?

How do I install Quote Lock?

pnpm dlx shadcn@latest add @bollard/quote-lock

The files land in your project. They're yours to edit.

How do I use Quote Lock in React?

quote-lock-usage.tsx
import { QuoteLock, type Quote } from "@/components/ui/quote-lock"

<QuoteLock
  label="You pay to send $180.00 to Maya"
  quote={opened}
  tolerance={0.5}
  locale="en-IN"
  onRequote={requote}
  onConfirm={(q) => new Promise<void>((resolve) => setTimeout(() => (setLog(`Paid with quote ${q.id}.`), resolve()), 600))}
/>

What input mistakes does Quote Lock catch?

  • Paying after the hold expired
  • New price worse than tolerance: Pay becomes Accept first
  • Pay pressed in the last seconds: re-quoted
  • Out-of-order quote responses and double presses
  • Client clock skew, when validFor is used

What props does Quote Lock accept?

QuoteLock props
PropTypeDefault
quote* (required)

The quote to show. A quote with a new `id` from the parent replaces the current one.

Quote—
onRequote* (required)

Fetch a fresh quote. Called when the hold ends (with `autoRequote`) or the user asks.

() => Quote | Promise<Quote>—
onConfirm* (required)

Pay with this exact quote. Reject to keep the user on the page with an error.

(quote: Quote) => void | Promise<void>—
onQuoteChange

Called with every quote the component adopts.

(quote: Quote) => void—
tolerance

Worse-by-more-than-this percent needs an explicit accept. 0 means any increase does.

number0
direction

"pay": higher is worse. "receive": lower is worse (what the recipient gets).

QuoteDirection"pay"
autoRequote

Fetch a new quote by itself when the hold runs out.

booleantrue
minTimeToPay

A Pay press with less hold than this (ms) gets a fresh quote first, since the payment may land after expiry.

number3000
label

Label above the amount, e.g. "You send".

React.ReactNode—
locale

BCP 47 locale for amounts and times.

string—
messages

Override any visible string.

Partial<QuoteLockMessages>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Quote Lock accessible?

  • The amount is always in the Pay label as text
  • Errors use role=alert; Pay uses aria-disabled outside the hold
  • Animations are skipped under reduced motion

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Honour only server-side quote IDs within their validity and reject a confirm against an expired or replaced quote; make confirm idempotent.

  • The server's quote and its expiry are the real truth
  • Tolerance and direction come from your props
  • Animated amounts need @number-flow/react and motion

What expensive mistakes does Quote Lock stop?

Helps prevent paying a re-quoted price nobody saw

Also known as

quote · fx rate · price lock · fare hold · swap · crypto · checkout · remittance

Field type

What dependencies does Quote Lock require?

Quote Lock facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameQuote Lock
Registry identifier@bollard/quote-lock
Install commandnpx shadcn@latest add @bollard/quote-lock
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react, @number-flow/react, motion
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Quote Lock

How does Quote Lock prevent financial transaction errors?

Quote Lock prevents paying a re-quoted price nobody saw. Blocks Paying after the hold expired, New price worse than tolerance: Pay becomes Accept first, Pay pressed in the last seconds: re-quoted, Out-of-order quote responses and double presses, Client clock skew, when validFor is used before processing. Limitation: apply idempotency keys for quote-lock.

How do I install quote-lock with shadcn?

Run `npx shadcn@latest add @bollard/quote-lock`. Sources added: registry/default/quote-lock/quote-lock.tsx, registry/default/quote-lock/quote.ts. Package requirements: lucide-react, @number-flow/react, motion.

What props customize Quote Lock?

Quote Lock accepts `quote`, `onRequote`, `onConfirm`, `onQuoteChange`, `tolerance`. Configures quote, fx rate, price lock behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of quote-lock?

The server's quote and its expiry are the real truth. Tolerance and direction come from your props. Animated amounts need @number-flow/react and motion Server requirement: Honour only server-side quote IDs within their validity and reject a confirm against an expired or replaced quote; make confirm idempotent.

How does Quote Lock meet accessibility guidelines?

The amount is always in the Pay label as text. Errors use role=alert; Pay uses aria-disabled outside the hold. Animations are skipped under reduced motion. Minimizes errors: price changed at payment, forex rate changed.

Which components pair with Quote Lock?