Plan Builder
Build what the user is about to buy by choosing quantities, with the price in real time: a custom plan with several resources, or a quantity of one item (extra notes, credits).
Overview
- `PlanBuilder`: lays out the resources and its
summary(anOrderSummary: a sticky card on large screens, a bar fixed to the bottom on smaller ones).isCalculatingturns everyPlanPrice(a price formatted by the app) into a skeleton while the app recalculates. - `PlanResource`: a card with
icon,title,descriptionand a controlledSlidernamed bylabel(value/onChange,minValue/maxValue/step,marks,formatValue,limitfor stock or quota left,isDisabled). Ahintunder the slider says why it stops or is disabled, and an optionalincludedaccordion lists what comes with it. - `PlanResourceAddon`: an add-on as a child of the resource — a switch with label and description.
The price, debouncing, limits and notices stay in the app.
Built-in text is in English; translate it with i18n.labels.
Installation
CLI
Manual
- 1
Register the @fma-ds namespace in components.json (once)
- 2
Add the item
Files land in
components/fma-ds/plan-builder/plan-builder.tsx; npm and registry dependencies are installed along with them.
Dependencies
- npm
- cn@^0.5.0