Skip to content

OrderTicket

Stable

A buy or sell form to place a trade: side, quantity, order type, price, product, a review summary and one submit button.

Also known as trade form, buy sell form, order form

Install with npm install @tattva/ui (setup), or copy the code from the kit in Downloads.

Market buy

RELIANCE

Last price 2,945.50

Order details
Side
Order type
Product
Margin needed
29,455.00
Worked out by the app.
Charges
41.20

The simple case. The app computes the summary rows and passes them in.

When to use it

Lets a person set up an order by hand, with every figure in view before they press the one button.

Made of: Symbol and last price · Side · Quantity · Order type · Price (limit and stop only) · Product · Stop and target · Summary rows · Submit button · Reason when locked

Use it for

  • A manual order the person types in themselves.
  • The inside of an ActionDraft when an AI drafted the order and the person edits it.
  • A locked ticket that explains in words why trading is paused.

Not for

  • Asking a person to approve something an agent wants to do: use ApprovalPrompt.
  • Showing a finished order as a record: use Receipt.
  • A single number input: use NumberField.

Do and avoid

RELIANCE

Last price 2,945.50

Order details
Side
Order type
Product
Margin needed
29,455.00
Worked out by the app.
Charges
41.20
Do. Every figure in view, then one button to place the order.

RELIANCE

Last price 2,945.50

Order details
Side
Order type
Product
Margin needed
29,455.00
Worked out by the app.
Charges
41.20
Avoid. A second buy button makes it easy to order by mistake.

Do

  • Pass cost and risk in summary so the person sees them before pressing.
  • Say why the ticket is locked with disabledReason.
  • Put it inside ActionDraft for an order an AI drafted.
  • Keep the button text specific, such as Buy RELIANCE.

Avoid

  • Do not place the order inside onChange. Only onSubmit, from a press, may start it.
  • Do not rely on the Buy and Sell words being coloured. They are not.
  • Do not compute money inside this part. Pass it in.
  • Do not add a second submit button.

On a phone

  • The form is one column and fills the width of its container up to 430px. Only Stop and Target sit side by side.
  • The submit button is full width and 48px tall on touch screens.
  • Quantity and price fields use the number fields, which are 16px on touch screens so the page does not zoom when they get focus.
  • Put the ticket where the on-screen keyboard will not hide the submit button, for example by letting the page scroll.

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started