A widget is additive, not a replacement. It layers your component onto a built-in page at a documented zone. Reach for it first whenever you just want to add something to an existing screen.
Add the button
1
Create the widget file
Drop a file under
src/widgets/. Export the component as the default and a config built with defineWidgetConfig. Target orders.detail.summary.after. Your component renders in the order summary section footer and receives the loaded order as data.apps/vendor/src/widgets/order-copy-link.tsx
2
Read the zone id
A zone id is
<domain>.<view>.<slot>.<placement>. The last segment is the placement.Multiple
before or after widgets on the same zone stack in registration order.3
Reload the panel
Start the project and open any order in the vendor portal. Widget files hot-reload. The Copy link button appears in the summary section footer, and the rest of the page is untouched.
Terminal
Order detail zones
These zones are mounted on the vendor order detail page.
Each zone is passed the loaded
order as data. The full, valid set is typed as WidgetZoneId and generated from the panel’s own zone hosts. Let your editor autocomplete zone: to see every option.
Verify
Confirm the widget works end to end.- Open an order. The Copy link button renders in the summary section footer.
- Click it. The link is copied and a toast appears.
- Change the zone to
orders.detail.side.beforeand reload. The button moves to the top of the sidebar. - Set
zone: "not.a.zone".tsc(bun run lint) fails with a “not assignable toWidgetZoneId” error. - Delete the file. The button disappears, and nothing else changed.
FAQ
What can I read from the order?
What can I read from the order?
The zone passes the loaded order as
data (HttpTypes.AdminOrder): id, display id, totals, items, payment_collections, customer, and more. Build the link (or any UI) from it.Can a block ship this instead of the host app?
Can a block ship this instead of the host app?
Yes. Put the same file in a block’s
vendor_ui entry under src/widgets/. Installing the block adds the button with no wiring.Next steps
Add a widget
The general widget model and the full list of zones.
Extend forms and tables
Add validated fields and columns with defineCustomFieldsConfig.