Prepare fixture offsets
Setup record / Example controller readings
Reported machine and work coordinates alongside editable draft offsets, explicit axis units and a host-owned apply request.
Setup record / Example controller readings
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { WorkOffsetPanel } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/work-offset-panel.
npx @noorddev/vlak-cli add work-offset-panel
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/work-offset-panel.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { WorkOffsetPanel } from "@noorddev/vlak-react";
<WorkOffsetPanel label="Work coordinates" name="fixture" activeSystemId="g54" offsetState="active" systems={[{ id: "g54", label: "G54" }, { id: "g55", label: "G55" }]} axes={[
{ id: "x", label: "X", unit: "mm", machine: 145, work: 20 },
{ id: "y", label: "Y", unit: "mm", machine: 60, work: 10 },
]} defaultValue={{ systemId: "g54", offsets: { x: 125, y: 50 } }} />Edit a proposed offset while retaining independently supplied machine and work positions.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | string | ||
axesrequired | readonly WorkOffsetAxis[] | ||
systemsrequired | readonly WorkOffsetSystem[] | ||
activeSystemIdrequired | string | null | Actual active system reported by the controller, independent of the draft selection. | |
value | WorkOffsetValue | ||
defaultValue | WorkOffsetValue | { systemId: null, offsets: {} } | |
onValueChange | (value: WorkOffsetValue) => void | ||
onApply | (value: WorkOffsetValue) => void | Request a complete offset update; machine control and coordinate calculations belong to the host. | |
offsetState | "active" | "suspended" | "unknown" | "unknown" | |
pending | boolean | false | |
readOnly | boolean | false | |
description | ReactNode |
Also accepts Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "defaultValue">.
| Keys | Does |
|---|---|
| Tab | Moves through the system selector, scroll region, axis offset inputs and apply action. |
| Arrow keys | Opens and navigates the Vlak system selector, steps number inputs or scrolls the focused table region. Escape closes the selector. |
| Enter, Space | Confirms a highlighted system or requests the focused Apply offsets action when a complete draft is available. |
<fieldset class="rs-work-offset-panel"><legend class="rs-work-offset-panel-legend">Work coordinates</legend><p class="rs-work-offset-panel-copy">Active system: G54 · Offsets active</p><div class="rs-work-offset-panel-field"><span id="work-offset-system-label">Draft coordinate system</span><div class="rs-select rs-select-fluid"><button type="button" class="rs-dropdown" role="combobox" aria-labelledby="work-offset-system-label" aria-expanded="false" aria-haspopup="listbox"><span>G54</span></button></div></div><label class="rs-work-offset-panel-field">X offset (mm)<input class="rs-input rs-input-full rs-work-offset-panel-control" type="number" step="any" value="125" /></label></fieldset>