Magoo Component UI logo Magoo Component UI
← Catalog

Order Ticket (Trade)

order-ticket-trade molecule experimental

A buy/sell order ticket - a green/red side toggle, order-type select, quantity and price inputs, an estimated cost and a place-order button.

Also in: FormsCards

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default

AAPL

Estimated cost $1,894.00
Sell

TSLA

Estimated cost $6,170.00

Props

NameTypeReq
symbol string ✓
side enum (buy | sell)
order_type string
quantity string
price string
estimated_cost string

Related components

How to use

The buy/sell colouring is pure CSS driven by the root data-state attribute (set from the side prop), so it renders statically. behavior.js wires interaction: clicking a side button updates data-state, which restyles the toggle and the place button; submitting the form calls preventDefault and dispatches an order:submit CustomEvent (bubbles) whose detail carries symbol, side, orderType, quantity and price. The order_type prop is carried on data-order-type and used as the event fallback. The portable self-init reads config from data-* attributes - no props object.

Use cases

formcard WCAG AA SEO 20 dir: both ai-generated