jatui

railNav

Keyboard navigation action for drawer/form rungs — up/down + left/right cycling

A Svelte action for form-like drawers where fields are "rungs" on a vertical rail. / step between fields; / cycle values.

Form with rail navigation

Priority
medium
← → to cycle
Status
open
← → to cycle

Click the panel to focus: ↑/↓ move between fields · ←/→ cycle values · Esc exit

Event log

No events yet — navigate the form

Usage

import { railNav } from 'jatui';

<div use:railNav={{
  order: () => ['title', 'type', 'priority'],
  onAction: (id, dir, host) => cycleField(id, dir),
  onEscape: () => closeDrawer(),
}}>
  <input data-rail-id="title" />
  <div   data-rail-id="type"     tabindex="-1">…</div>
  <div   data-rail-id="priority" tabindex="-1">…</div>
</div>

CSS contract

Two classes are applied to rung host elements — style them in your app or component scope:

ClassWhen appliedSuggested style
.rail-focusCurrently active rungOutline ring (keyboard-only via :focus-visible)
.rail-cycled~280ms after ← / → firesBrief background pulse confirming value changed