Inspect a stack
Sample 042 / Recorded image stack
Navigates supplied depth, time, channel and stage-position axes while preserving exact physical readings and indexed positions.
Sample 042 / Recorded image stack
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 { StackNavigator } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/stack-navigator.
npx @noorddev/vlak-cli add stack-navigator
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/stack-navigator.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 { StackNavigator } from "@noorddev/vlak-react";
<StackNavigator label="Image stack" name="stack" axes={[
{ id: "depth", label: "Depth", unit: "µm", positions: [{ value: -1 }, { value: 0 }, { value: 1 }] },
{ id: "time", label: "Time", unit: "s", positions: [{ value: 0 }, { value: 5 }, { value: 10 }] },
{ id: "channel", label: "Channel", positions: [{ value: "Phase" }, { value: "Channel 2" }] },
{ id: "stage", label: "Stage position", unit: "µm", positions: [{ value: "x 12.5, y -1.5" }] },
]} defaultValue={{ depth: 1, time: 0, channel: 0, stage: 0 }} />Navigates supplied stack coordinates without calculating stage positions or calling an instrument.
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | ReactNode | ||
axesrequired | readonly StackAxis[] | ||
value | Readonly<Record<string, number | null>> | ||
defaultValue | Readonly<Record<string, number | null>> | {} | |
onValueChange | (value: StackSelection) => void | ||
description | ReactNode | ||
readOnly | boolean | false |
Also accepts Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "defaultValue">.
| Keys | Does |
|---|---|
| Tab | Moves between enabled previous, position-select and next controls. |
| Arrow keys, Home, End, typing | Opens and navigates the position list; disabled positions are skipped. |
| Enter, Space | Confirms the active list option or activates the focused previous or next button. |
| Escape | Closes the position list without changing selection. |
<fieldset class="rs-stack-navigator"><legend class="rs-stack-navigator-legend">Image stack</legend><div class="rs-stack-navigator-axis"><p class="rs-stack-navigator-label">Depth</p><p class="rs-stack-navigator-copy">Position 1 of 3; -1 µm</p></div></fieldset>