Action

Vertical Navigation

Enables up/down arrow key navigation.

Installation

Get the action

npx lomer-ui action vertical-navigation
Source code

Usage

Preview

Focus inside form.

Then use up/down arrow keys to navigate.

Field 1

Field 2

Field 3

Field 4

Svelte Code

1
<script>
2
  import Field from '$lib/components/base/field.svelte';
3
  import Input from '$lib/components/base/input.svelte';
4
  import { verticalNavigation } from '$lib/actions/vertical-navigation.svelte';
5
</script>
6

7
<form class="flex flex-col gap-4" use:verticalNavigation>
8
  <div class="mb-2">
9
    <p>Focus inside form.</p>
10
    <p>Then use up/down arrow keys to navigate.</p>
11
  </div>
12
  <Field label="Field 1">
13
    <Input />
14
  </Field>
15
  <Field label="Field 2">
16
    <Input />
17
  </Field>
18
  <Field label="Field 3">
19
    <Input />
20
  </Field>
21
  <Field label="Field 4">
22
    <Input />
23
  </Field>
24
</form>
25