Inputs

18 controls

Every control in @nkapp/lib that reads a value from an operator, with its whole prop surface: labels, descriptions, errors, required, disabled, read-only, and the empty state where one exists. The values are the ones these controls actually carry in Nanokit — service names, ports, regions, deploy targets.

Regression watch

Two shipped bugs are pinned here. Both passed code review and both were obvious on screen, which is why they live on the page and not only in a unit test.

NkCheckbox

The off state must be drawn
state matrixsix labels, six boxes — a label with no box in front of it is the regression
label + description (interactive)click it — the box must be drawn before and after

Current value: false

Separate known gap, not part of this fix: isIndeterminate paints nothing. react-aria emits data-indeterminate, which no class targets, and the tick glyph is rendered at scale-0 while unselected — so the mixed state is pixel-identical to the off state above.

Correct
Six labels below, six boxes. An unchecked box is a 2px border-muted-foreground/30 outline over a transparent fill; a checked box is a solid bg-primary square with a tick. Off and on are both clearly drawn, in light and dark.
Regressed
The off state was written with not-selected: classes, but react-aria-components emits only data-selected — there is no data-not-selected — so those rules never matched a single element. An unchecked box got no border and no background: the rows above would show a label with nothing in front of it, and a form would ship with invisible checkboxes.

NkInput

Hover must reach the border
hover target: the field
Move the pointer over the box — the 1px border turns Signal Blue.
hover target: the leading iconicon={Server}
Hover the icon itself, not the text area. The wrapper is the group.
hover target: the reveal buttontype="password"
Hover the eye button on the right, then click it to toggle visibility.
Correct
Hover each of the three fields below, and hover them in three places: the text box, the leading icon, and the password reveal button. All three brighten the same 1px border to Signal Blue, because the wrapper carries group and the input carries group-hover:border-primary.
Regressed
The hover border used to be injected at runtime as oklch(var(--primary)). In Hub, admin, account, auth and status, --primary holds an HSL triplet (221.2 83.2% 53.3%), so the declaration was invalid CSS and the browser dropped it — !important included. Hovering a field did nothing at all, on any of the three targets.

Text fields

Both wrap react-aria TextField, so the label, the description and the error are bound to the control by id and the error is announced.

NkInput

react-aria TextField

description and error share one slot: when both are set the error wins and the description is not rendered.

label + value
requiredappends a * to the label
description
Polled every 5s while a deploy gate is open.
errorsets data-invalid and a destructive border
Port must be between 1 and 65535
disabled / readOnly

NkTextArea

react-aria TextField

The same field contract as NkInput minus the icon and the password reveal. rows sets the initial height; the control stays resize-y.

label + rows
description
Runs once per container, before the start command.
error
Required for a production rollback
required / disabled / readOnly

Verification code

One control, one job: the six characters standing between an operator and their account. It backs the email-OTP and TOTP steps in @nkapp/auth-core, so it is shown here as a verification step rather than as a row of boxes.

NkOtpInput

live challenge

Controlled through value / onChange, with onComplete firing synchronously on the sixth character — so an auto-submitting consumer is handed the code as an argument and never has to read back state that has not re-rendered. The field turns read-only while status="pending", so the code cannot change underneath the request that is verifying it. Editing after a rejection clears both error and status and returns the field to neutral.

the challengetype 424242 to pass — any other code fails

Two-factor authentication

Step 2 of 2 — confirm it is you before the session is issued.

Sent to ops@kama.nkapp.at. Expires in 10 minutes.
drive it
callback logonComplete fires once per distinct complete code — never twice for the same one
  • no callbacks yet — type or press a button above

status idle · value (empty)

NkOtpInput

4 statuses

idle · error · success · pending. A non-empty error forces the error status on its own, matching NkInput — and it is announced, not just coloured. pending is the in-flight state: read-only, dimmed, caret suppressed.

status="idle"empty and partial
errorerror text sets the status by itself
Code expired. Request a new one.Verification code complete
status="success"

Device verified.

Verification code complete
status="pending"read-only while the server answers
Verification code complete
disabled / required

NkOtpInput

shape · charset · size

length sets the cell count, groupSize inserts a hairline every N cells, and charset picks the sanitiser — numeric also sets inputMode="numeric" so a phone opens the digit pad, alphanumeric upper-cases as you type. Paste a whole code into any cell and it fills the field from the start.

length={6} groupSize={3}the email/TOTP default
length={6} — no grouping
length={4}a short PIN
length={8} groupSize={4} charset="alphanumeric"a recovery code — try typing letters
maskrenders • but the input stays type=text, so autofill survives
Verification code complete
placeholder="0"dimmed in every empty cell that is not the active one
size sm / md / lg

NkOtpInput

one input, not six

Press the count button: there is exactly one <input> in this specimen. The cells are an aria-hidden decorative row under a single real field whose text is transparent — which is what makes autocomplete="one-time-code" work, because iOS and Android offer the code to a single field. Six inputs would also announce six unlabelled edit fields to a screen reader instead of one named one, and dead-end backspace at each box boundary.

inputs in this specimen: not counted · field value (empty)

The second button writes through the native value setter and dispatches input — the same DOM path Playwright's .fill() takes, and the one apps/auth-e2e/src/totp.spec.ts drives against #totp-otp-input. Against six inputs it would write all six characters into the first box.

Choice

One value from a known set (NkSelect, NkComboBox, NkEnvSelect) or several at once (NkMultiSelect). All four render their list in a react-aria Popover, so a long option list never widens the page.

NkSelect

react-aria Select

Controlled by value / onValueChange. Given an empty optionsarray the popover renders its own “No options available” row instead of an empty box.

value + onValueChange
Database engine

Selected: postgres

placeholder + icon + isRequired
ProviderOnly the roadmap.v1 providers are selectable.
error
Regionfra1 has no capacity for this instance size
isDisabled
Compute mode
options={[]}the popover's own empty state
Restore point

NkComboBox

react-aria ComboBox

A select that filters as you type. allowsCustomValue lets the typed string through when it matches no option — the difference between picking a known region and naming a new database branch.

filterable list

Selected: ams3

allowsCustomValue + icon + description
A name with no match is kept verbatim and forks a new branch.

Branch: main

isRequired / error
Target must be reachable over SSH
isDisabled

NkEnvSelect

NkSelect preset

NkSelect with the environment list baked in and a Layers icon. showAll (on by default) prepends the all row; showGlobal adds global, where root-level config lives.

showAll (default) + showGlobal
Environment

Scope: production

showAll={false}a strict per-environment picker
Target environment
allLabelreplaces the default All Environments row
Filter
isDisabled
Locked

NkMultiSelect

Popover + ListBox

Selections render as removable chips inside the trigger, and the popover carries its own search box so a long list stays usable. Controlled by selectedValues / onChange.

selectedValues + icon + isRequired
Where this service is replicated.

Selected: fra1,ams3

errorclears as soon as one scope is picked
Pick at least one scope
isDisabled
options={[]}nothing to pick yet

Binary and segmented

Controls with no popover: the current value is always on screen, which is what a settings panel needs.

NkSwitch

react-aria Switch

Off is a bordered grey track, on is bg-primary, and the knob stays a light disc in both themes. isReadOnly looks enabled but refuses the toggle; isDisabled dims the whole control to 50%.

label + description (interactive)

Current value: true

off / onfixed states, for comparison
isDisabled / isReadOnly
aria-label onlyno visible label

NkToggleGroup

3 variants

One value from a short, always-visible set. horizontal is a pill row, cardsalso renders each option's description, and segmentedis the compact toolbar form that uses each option's icon. Built on react-aria's ToggleButtonGroup, which emits the same radiogroup / radio / aria-checked the hand-rolled version wrote by hand — and adds the focus management it never implemented.

keyboardwhat the arrow keys actually do — stated precisely

Tab into the row below, then press the arrow keys. They move focus, not the selection — selection is still made with Enter, Space or a click. react-aria does not apply a roving tabindex here either: every option keeps tabindex="0", so tabbing walks through all three rather than leaving the group. That is a strict improvement on the previous no-key-handling-at-all, not the complete WAI-ARIA radio-group pattern.

variant="horizontal"re-click the selected pill: disallowEmptySelection re-fires onChange rather than clearing it

onChange fired 0 times

variant="cards"renders option.description
variant="segmented"renders option.icon

Selected: team · container · apps

Numeric and time

Both clamp on their own: the number picker disables the arrow it cannot honour, and the hour picker only ever emits 0 to 23.

NkNumberPicker

min · max · step

react-aria's NumberField, so the parsing is locale-aware, the value clamps on blur, the scroll wheel adjusts it while focused, and the step buttons disable themselves at the bounds. Both buttons are 44px — a real touch target.

min=1 max=10 (interactive)press and hold either button — it repeats

Replicas: 3

step=256 (interactive)memory in MB — note 4096, not 4,096

Memory limit: 512m — formatOptions pins useGrouping: false, because a locale-grouped 4,096 is not a value any call site here wants to read back.

the emptied-field contractselect the text, delete it, and watch the readout

Retention: 14d — react-aria reports an emptied field as NaN; the component swallows it, so the consumer hears nothing while the field is mid-edit and react-aria restores the last valid value on blur. The number above never flickers to NaN.

at min / at maxthe arrow that cannot move is disabled
disabled

NkHourPicker

0–23

A 24-slot picker for the hour of a cron window. value is the raw hour, so the caller never parses a formatted string back into a number.

label + value (interactive)
Run backup at

Cron: 0 3 * * * · emitted value 3

no labelfalls back to the "Hour" label
Hour
disabled
Locked window

Filters and config scaffolding

Three controls that frame other controls rather than holding a value of their own.

NkSearchFilter

toolbar filter

Grows on focus and shows a clear button once it holds text. hideOnMobile defaults to true — the first variant disappears below the smbreakpoint, the second does not. react-aria's SearchField makes it a real type="search", so AT announces a search box rather than a generic textbox.

defaulthidden below sm — type, then press Escape

Query: (empty) — Escape clears the field while it is focused, and onChange receives the empty string the same way it does for typing and for the clear button. There is exactly one X: WebKit paints its own for type="search" and the component suppresses it.

hideOnMobile={false} + full width

NkConfigField

4 statuses

Wraps any control with a label, a hover-tip description and a save status. The status is written next to the label as a word, so the state is legible without colour.

statusidle · pending · success · error
Permission denied
expertOnlyisExpertMode={false} renders nothing

NkReveal

react-aria Disclosure

Collapses optional settings behind a trigger row. defaultExpanded opens it on mount; the panel animates height and opacity, so a whole form can live inside one.

postgres://app:••••••@db.internal:5432/kama

Dynamic lists

The three row editors behind Nanokit's service config forms. Each is fully controlled (value / onChange), adds a row from the button in its own header, and removes a row from the trash button at the end of that row. Every one is shown populated and empty.

NkKeyValueList

Record<string,string>

The env-var editor. A new row is seeded as NEW_KEY, de-duplicated with a numeric suffix; a row whose key is blank is dropped from the emitted record, so an unfinished row never reaches the config.

populatededit a key and watch the JSON below
Env vars

No items added.

{
  "DATABASE_URL": "db://kama-pg",
  "NODE_ENV": "production",
  "LOG_LEVEL": "info"
}
emptyvalue={{}}
Build args

No items added.

NkStringList

string[]

One free-text row per entry — volumes, domains, depends_on. Unlike the key-value editor it keeps blank rows, because a blank row is one the operator is still typing into.

populated
Volumes
[
  "nk-kama-prod-pgdata:/var/lib/postgresql/data",
  "nk-kama-prod-uploads:/srv/uploads"
]
emptyvalue={[]}
Domains

No items added.

NkPortList

PortMapping[]

Host port, container port, protocol and a UFW firewall flag per row — { host, container, protocol, firewall }. A new row defaults to tcp with the firewall on.

populated
Ports & UFW firewall
UFW Firewall
UFW Firewall
UFW Firewall
[{"host":"80","container":"8080","protocol":"tcp","firewall":true},{"host":"443","container":"8443","protocol":"tcp","firewall":true},{"host":"53","container":"53","protocol":"udp","firewall":false}]
emptyvalue={[]}
Extra ports

No custom ports mapped.