Calm motion: animations on this site only fade, with no movement
Bill of materials
A tree of parts with quantities, and the total for one or more units
A bill of materials (BOM) lists what goes into a product, part by part. It plans a build in an ERP or a workshop app.
Basic
Desk mic kit
- Microphone unit ASM-MIC1 each25 in all
- Condenser capsule CAP-161 pcs each25 pcs in all
- USB board PCB-USB1 pcs each25 pcs in all
- Metal body BDY-AL1 pcs each25 pcs in all
- M2 screw SCR-M26 pcs each150 pcs in all
- Desk stand ASM-STD1 each25 in all
- Weighted base BAS-011 pcs each25 pcs in all
- M2 screw SCR-M22 pcs each50 pcs in all
- USB-C cable, 2 m CBL-USBC1 pcs each25 pcs in all
Parts cost Rp 10.380.000
productis the name of the product at the top.partsis the tree. Each part has anid, aname, and thequantityfor one of its parent. It can also have asku, aunit, acostof one, andchildren.v-model:countis the number of products to build (default 1). Each row shows the quantity for one parent, "each", and the total for the build, "in all".- A part with children has a button that opens and closes its group. Screen readers hear whether the group is open.
- The status line gives the cost of the raw parts for the build. A raw part is a part with no children. The same SKU in two places adds up.
currencyis an ISO 4217 code (defaultUSD), andlocalesets the format.- Change the words with
labelsor a label pack:title,build, and the functionsper,total,cost, andopen.
The bomNeeds function lists the raw parts and the cost. It is exported, for example to make a purchase list.
Usage
ts
import { BlessBillOfMaterials } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
product* | string | — | the product at the top |
parts* | BlessBomPart[] | — | |
currency | string | "USD" | |
locale | string | "en" | |
labels | Partial<{ title: string; build: string; per: (q: string) => string; total: (q: string) => string; cost: (amount: string) => string; open: (name: string) => string; }> | — | |
count | number | 1 | how many of the product to build |
Events
| Name | Payload | Description |
|---|---|---|
update:count | [value: number] |