Assembly variant matrix

Edits independent population, bill-of-materials, and placement flags per reference and assembly variant, preserving unspecified choices.

Assembly options
Reference / variantPilotProduction
R110 kΩ resistor
Edit R1 in PilotPopulated: Yes · Bill: Yes · Placement: Yes
Populated
In bill of materials
In placement file
Edit R1 in ProductionPopulated: No · Bill: Yes · Placement: No
Populated
In bill of materials
In placement file

Population, bill of materials, and placement choices are independent.

Specify each build

Sensor board · assembly review

Assembly options
Reference / variantPilotProduction
R110 kΩ resistor
Edit R1 in PilotPopulated: Yes · Bill: Yes · Placement: Yes
Populated
In bill of materials
In placement file
Edit R1 in ProductionPopulated: No · Bill: Yes · Placement: No
Populated
In bill of materials
In placement file
C1100 nF capacitor
Edit C1 in PilotNot specified
Populated
In bill of materials
In placement file
Edit C1 in ProductionPopulated: Yes · Bill: Yes · Placement: Yes
Populated
In bill of materials
In placement file

Population, bill of materials, and placement choices are independent.

Use it for

  • Caller-owned assembly references, part labels, and named build variants.
  • Three independent boolean-or-null flags: population, bill-of-materials inclusion, and placement-file inclusion.
  • value/defaultValue/onValueChange to receive the proposed cell array; editing one flag leaves the other flags unchanged.
  • Missing cells begin unspecified. Conflicting duplicate cells and unavailable references remain visible rather than being silently merged.

Not for

  • Inferring bill-of-materials or placement policy from the populated flag.
  • Assuming the component generates manufacturing files or changes a board design.
  • Treating unspecified flags as excluded or not populated.

Three ways in. They share one source, so the pixels match whichever you pick.

1. Import the package

npm install @noorddev/vlak-react

// once, next to your app's root
import "@noorddev/vlak-react/css";

import { AssemblyVariantMatrix } from "@noorddev/vlak-react";

Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/assembly-variant-matrix.

2. Vendor the source

npx @noorddev/vlak-cli add assembly-variant-matrix

The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.

3. Through shadcn

npx shadcn add https://vlak.dev/r/assembly-variant-matrix.json

The same registry item, installed by shadcn's CLI.

CSS only

<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />

No React. Link vlak.css and use the markup and classes below.

import { AssemblyVariantMatrix } from "@noorddev/vlak-react";

<AssemblyVariantMatrix label="Assembly options" name="assembly"
  references={[{ id: "r1", label: "R1", partLabel: "10 kΩ resistor" }]}
  variants={[{ id: "pilot", label: "Pilot" }, { id: "production", label: "Production" }]}
  defaultValue={[{ referenceId: "r1", variantId: "pilot", populated: true, includeInBom: true, includeInPlacement: true }, { referenceId: "r1", variantId: "production", populated: false, includeInBom: true, includeInPlacement: false }]} />

AssemblyVariantMatrix

Independent fitted, bill-of-materials and placement choices per reference and variant.

PropTypeDefaultDescription
labelrequiredReactNode
referencesrequiredAssemblyReference[]
variantsrequiredAssemblyVariant[]
valueAssemblyVariantState[]
defaultValueAssemblyVariantState[][]
onValueChange(cells: AssemblyVariantState[]) => void
readOnlyboolean

Also accepts Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "defaultValue" | "onChange">.

KeysDoes
TabMoves through native cell summaries and controls in expanded editors.
Enter, SpaceOpens or closes the focused cell's native details editor.
Arrow keysOpens and navigates the Vlak selector between Unspecified, Yes, and No; Enter confirms the highlighted choice.
<fieldset class="rs-assembly-variant-matrix"><legend class="rs-assembly-variant-matrix-legend">Assembly options</legend><div class="rs-assembly-variant-matrix-viewport"><table class="rs-assembly-variant-matrix-table"><thead><tr><th class="rs-assembly-variant-matrix-header" scope="col">Reference / variant</th><th class="rs-assembly-variant-matrix-header" scope="col">Pilot</th></tr></thead><tbody><tr><th class="rs-assembly-variant-matrix-header" scope="row">R1<span class="rs-assembly-variant-matrix-part">10 kΩ resistor</span></th><td class="rs-assembly-variant-matrix-cell"><details class="rs-assembly-variant-matrix-details"><summary class="rs-assembly-variant-matrix-summary">Edit R1 in Pilot<span class="rs-assembly-variant-matrix-part">Not specified</span></summary><div class="rs-assembly-variant-matrix-editor"><div class="rs-assembly-variant-matrix-field"><span>Populated</span><div class="rs-select rs-select-fluid rs-assembly-variant-matrix-select"><button class="rs-dropdown" role="combobox" aria-label="Populated, R1 in Pilot" aria-haspopup="listbox" aria-expanded="false" type="button">Unspecified</button></div></div></div></details></td></tr></tbody></table></div></fieldset>
.rs-assembly-variant-matrix.rs-assembly-variant-matrix-legend.rs-assembly-variant-matrix-viewport.rs-assembly-variant-matrix-table.rs-assembly-variant-matrix-header.rs-assembly-variant-matrix-part.rs-assembly-variant-matrix-cell.rs-assembly-variant-matrix-details.rs-assembly-variant-matrix-summary.rs-assembly-variant-matrix-editor.rs-assembly-variant-matrix-field.rs-assembly-variant-matrix-select.rs-assembly-variant-matrix-note