Navigation
These components move people between views, sections and steps. The Reka-based ones forward their primitive’s props and emits and expose the Reka element through ref. Every part also takes class, merged with cn(). Tabs, accordions, steppers, breadcrumbs, pagination and sidenavs also take an items prop that renders the whole anatomy from data, for when you do not need custom parts.
NwTabs
Section titled “NwTabs”Switches between panels in place, wrapping Reka Tabs. Add NwTabsIndicator inside the list for the sliding wire underline or segment.
4.2 Gbit/s in, 3.9 Gbit/s out, peak at 21:40 UTC.
<script setup lang="ts">import { ref } from 'vue'import { NwProvider, NwTabs, NwTabsContent, NwTabsIndicator, NwTabsList, NwTabsTrigger,} from '@nyxwire/vue'
const view = ref('traffic')</script>
<template> <NwProvider> <NwTabs v-model="view" class="w-full max-w-lg"> <NwTabsList aria-label="Relay views"> <NwTabsTrigger value="traffic">Traffic</NwTabsTrigger> <NwTabsTrigger value="peers">Peers</NwTabsTrigger> <NwTabsTrigger value="capture" disabled>Capture</NwTabsTrigger> <NwTabsIndicator /> </NwTabsList> <NwTabsContent value="traffic"> <p class="text-fg-muted">4.2 Gbit/s in, 3.9 Gbit/s out, peak at 21:40 UTC.</p> </NwTabsContent> <NwTabsContent value="peers"> <p class="text-fg-muted">ams-01, hel-01 and waw-03 are peered over WireGuard.</p> </NwTabsContent> </NwTabs> </NwProvider></template>NwTabs├─ NwTabsList│ ├─ NwTabsTrigger (value)│ └─ NwTabsIndicator└─ NwTabsContent (value)| Prop | Type | Default | Effect |
|---|---|---|---|
modelValue |
string | number |
none | Active tab, v-model |
defaultValue |
string | number |
none | Uncontrolled initial tab; with items, the first enabled one |
variant |
'line' | 'segment' |
'line' |
Underline under the list, or a segmented control |
size |
'sm' | 'md' | 'lg' |
'md' |
Trigger height and text size |
intent |
'primary' | 'secondary' | 'tertiary' | 'neutral' | 'info' | 'success' | 'warning' | 'danger' |
'primary' |
Color of the indicator and the active trigger |
stretch |
boolean |
false |
Triggers share the list width equally |
items |
readonly NwOption[] |
none | Renders one tab per { value, label, disabled? }; panels are named slots |
label |
string |
none | Accessible name of the list generated from items |
orientation |
'horizontal' | 'vertical' |
'horizontal' |
Vertical tabs put the list beside the panels (Reka) |
activationMode |
'automatic' | 'manual' |
'automatic' |
manual waits for Enter or Space before switching (Reka) |
unmountOnHide |
boolean |
true |
Removes hidden panels from the DOM (Reka) |
Keyboard and accessibility. The list has the tablist role and each trigger is a tab linked to its tabpanel, with aria-selected on the active one. Arrow keys move along the list, skip disabled tabs and, in automatic mode, activate the tab they land on. Name the list with aria-label (or label with items). The indicator is aria-hidden.
NwAccordion
Section titled “NwAccordion”A stack of sections that expand and collapse, wrapping Reka Accordion. Each trigger ends with a plus icon that turns into a cross when its section opens.
<script setup lang="ts">import { NwAccordion, NwAccordionContent, NwAccordionItem, NwAccordionTrigger, NwProvider,} from '@nyxwire/vue'</script>
<template> <NwProvider> <NwAccordion type="single" default-value="health" collapsible class="w-full max-w-lg"> <NwAccordionItem value="health"> <NwAccordionTrigger>Health checks</NwAccordionTrigger> <NwAccordionContent>Every relay answers a TCP probe every 10 seconds.</NwAccordionContent> </NwAccordionItem> <NwAccordionItem value="failover"> <NwAccordionTrigger>Failover policy</NwAccordionTrigger> <NwAccordionContent >Three missed probes move traffic to the nearest healthy relay.</NwAccordionContent > </NwAccordionItem> <NwAccordionItem value="keys" disabled> <NwAccordionTrigger>Key escrow</NwAccordionTrigger> <NwAccordionContent>Requires the security role.</NwAccordionContent> </NwAccordionItem> </NwAccordion> </NwProvider></template>NwAccordion└─ NwAccordionItem (value) ├─ NwAccordionTrigger └─ NwAccordionContent| Prop | Type | Default | Effect |
|---|---|---|---|
type |
'single' | 'multiple' |
none | One open item at a time, or any number (Reka) |
modelValue |
string | string[] |
none | Open item(s), v-model |
defaultValue |
string | string[] |
none | Uncontrolled open item(s) (Reka) |
collapsible |
boolean |
false |
With type="single", lets the open item close (Reka) |
variant |
'line' | 'panel' | 'ghost' |
'line' |
Divided rows, separate cut panels, or no rules |
items |
readonly NwOption[] |
none | Renders one item per option; each panel is the slot named after its value |
disabled |
boolean |
false |
Disables every item; NwAccordionItem takes it too (Reka) |
Keyboard. ArrowDown and ArrowUp move between triggers, Home and End jump to the ends, Space or Enter toggles the focused item. A single accordion closes the open item when another opens.
NwCollapsible
Section titled “NwCollapsible”One section that shows and hides, wrapping Reka Collapsible. Use it for optional details; use NwAccordion for a set of sections.
<script setup lang="ts">import { ref } from 'vue'import { NwCollapsible, NwCollapsibleContent, NwCollapsibleTrigger, NwProvider } from '@nyxwire/vue'
const open = ref(false)</script>
<template> <NwProvider> <NwCollapsible v-model:open="open" class="w-full max-w-lg"> <NwCollapsibleTrigger>{{ open ? 'Hide' : 'Show' }} raw handshake</NwCollapsibleTrigger> <NwCollapsibleContent> <p class="px-3 py-4 font-mono text-sm text-fg-muted"> initiation 148 B · response 92 B · keepalive every 25 s </p> </NwCollapsibleContent> </NwCollapsible> </NwProvider></template>NwCollapsible├─ NwCollapsibleTrigger└─ NwCollapsibleContent| Prop | Type | Default | Effect |
|---|---|---|---|
open |
boolean |
none | Controlled state, v-model:open (Reka) |
defaultOpen |
boolean |
false |
Uncontrolled initial state (Reka) |
disabled |
boolean |
false |
The trigger stops toggling (Reka) |
unmountOnHide |
boolean |
true |
Removes the closed content from the DOM (Reka) |
Keyboard and accessibility. The trigger is a button with aria-expanded and aria-controls; Enter or Space toggles it.
NwNavigationMenu
Section titled “NwNavigationMenu”Site navigation with dropdown panels, wrapping Reka NavigationMenu. Triggers open their content on hover or click; NwNavigationMenuViewport hosts the open panel and NwNavigationMenuIndicator points at its trigger. NwNavigationMenuSub nests a second level inside a panel.
<script setup lang="ts">import { NwNavigationMenu, NwNavigationMenuContent, NwNavigationMenuIndicator, NwNavigationMenuItem, NwNavigationMenuLink, NwNavigationMenuList, NwNavigationMenuTrigger, NwNavigationMenuViewport, NwProvider,} from '@nyxwire/vue'</script>
<template> <NwProvider> <NwNavigationMenu aria-label="Console sections"> <NwNavigationMenuList> <NwNavigationMenuItem value="network"> <NwNavigationMenuTrigger>Network</NwNavigationMenuTrigger> <NwNavigationMenuContent> <NwNavigationMenuLink href="#nwnavigationmenu" active>Relays</NwNavigationMenuLink> <NwNavigationMenuLink href="#nwnavigationmenu">Routes</NwNavigationMenuLink> <NwNavigationMenuLink href="#nwnavigationmenu">Peering</NwNavigationMenuLink> </NwNavigationMenuContent> </NwNavigationMenuItem> <NwNavigationMenuItem value="security"> <NwNavigationMenuTrigger>Security</NwNavigationMenuTrigger> <NwNavigationMenuContent> <NwNavigationMenuLink href="#nwnavigationmenu">Keys</NwNavigationMenuLink> <NwNavigationMenuLink href="#nwnavigationmenu">Audit log</NwNavigationMenuLink> </NwNavigationMenuContent> </NwNavigationMenuItem> <NwNavigationMenuIndicator /> </NwNavigationMenuList> <NwNavigationMenuViewport align="start" /> </NwNavigationMenu> </NwProvider></template>NwNavigationMenu├─ NwNavigationMenuList│ ├─ NwNavigationMenuItem (value)│ │ ├─ NwNavigationMenuTrigger│ │ └─ NwNavigationMenuContent│ │ ├─ NwNavigationMenuLink (href, active)│ │ └─ NwNavigationMenuSub (optional second level)│ └─ NwNavigationMenuIndicator└─ NwNavigationMenuViewportNwNavigationMenu forwards Reka’s root props (v-model, delayDuration, orientation, …). NwNavigationMenuLink adds an href prop and takes Reka’s active, which sets aria-current="page". The trigger draws a chevron unless it is rendered as-child.
Keyboard. Tab reaches each trigger; Enter, Space or ArrowDown opens its panel and moves into the links. Escape closes the panel and returns focus to its trigger. Name the menu with aria-label.
NwPagination
Section titled “NwPagination”Page controls for a long list, wrapping Reka Pagination. Without a default slot it renders the full control set for you; with one, the list’s slot provides the page items, including ellipses, so you render numbers and gaps yourself.
- Event 01: route update
- Event 02: route update
- Event 03: route update
- Event 04: route update
<script setup lang="ts">import { computed, ref } from 'vue'import { NwPagination, NwPaginationEllipsis, NwPaginationFirst, NwPaginationLast, NwPaginationList, NwPaginationListItem, NwPaginationNext, NwPaginationPrev, NwProvider,} from '@nyxwire/vue'
const events = Array.from( { length: 48 }, (_, index) => `Event ${String(index + 1).padStart(2, '0')}: route update`,)const page = ref(1)const perPage = 4const visible = computed(() => events.slice((page.value - 1) * perPage, page.value * perPage))</script>
<template> <NwProvider> <div class="grid w-full max-w-lg gap-4"> <ul class="m-0 grid list-none gap-1 p-0 text-sm text-fg-muted"> <li v-for="event in visible" :key="event">{{ event }}</li> </ul> <NwPagination v-model:page="page" :total="events.length" :items-per-page="perPage" :sibling-count="1" show-edges label="Event log pages" > <NwPaginationList v-slot="{ items }"> <NwPaginationFirst /> <NwPaginationPrev /> <template v-for="(item, index) in items" :key="index"> <NwPaginationListItem v-if="item.type === 'page'" :value="item.value" /> <NwPaginationEllipsis v-else /> </template> <NwPaginationNext /> <NwPaginationLast /> </NwPaginationList> </NwPagination> </div> </NwProvider></template>NwPagination└─ NwPaginationList (slot: { items }) ├─ NwPaginationFirst ├─ NwPaginationPrev ├─ NwPaginationListItem (value) | NwPaginationEllipsis ├─ NwPaginationNext └─ NwPaginationLast| Part | Prop | Type | Default | Effect |
|---|---|---|---|---|
NwPagination |
itemsPerPage |
number |
10 |
Items on one page |
total |
number |
0 |
Number of items (Reka) | |
page |
number |
none | Current page, v-model:page (Reka) |
|
defaultPage |
number |
1 |
Uncontrolled initial page (Reka) | |
siblingCount |
number |
2 |
Pages shown on each side of the current one (Reka) | |
showEdges |
boolean |
false |
Always shows the first and last page (Reka) | |
size |
'sm' | 'md' | 'lg' |
'md' |
Size of every button | |
intent |
NwIntent |
'primary' |
Color of the current page | |
label |
string |
'Pagination' |
aria-label of the navigation landmark |
|
disabled |
boolean |
false |
Disables every control (Reka) | |
NwPaginationFirst |
label |
string |
'First page' |
Accessible name of the icon button |
NwPaginationPrev |
label |
string |
'Previous page' |
Accessible name of the icon button |
NwPaginationNext |
label |
string |
'Next page' |
Accessible name of the icon button |
NwPaginationLast |
label |
string |
'Last page' |
Accessible name of the icon button |
Accessibility. The root renders a <nav> named by label; name it after its list when a page has several. The current page carries aria-current="page", and First and Previous are disabled on page 1 (Next and Last on the final page). Ellipses are aria-hidden.
NwBreadcrumb
Section titled “NwBreadcrumb”The path from the top of a hierarchy to the current page. It is plain markup on Reka’s Primitive, with no state of its own; the demo trims the trail when you pick an ancestor.
<script setup lang="ts">import { computed, ref } from 'vue'import { NwBreadcrumb, NwBreadcrumbEllipsis, NwBreadcrumbItem, NwBreadcrumbLink, NwBreadcrumbList, NwBreadcrumbPage, NwBreadcrumbSeparator, NwProvider,} from '@nyxwire/vue'
const path = ['Regions', 'eu-north', 'Relays', 'hel-01']const depth = ref(path.length)const trail = computed(() => path.slice(0, depth.value))</script>
<template> <NwProvider> <div class="grid gap-3"> <NwBreadcrumb> <NwBreadcrumbList> <NwBreadcrumbItem> <NwBreadcrumbLink href="#nwbreadcrumb">Console</NwBreadcrumbLink> </NwBreadcrumbItem> <NwBreadcrumbSeparator /> <NwBreadcrumbItem> <NwBreadcrumbEllipsis /> </NwBreadcrumbItem> <template v-for="(segment, index) in trail" :key="segment"> <NwBreadcrumbSeparator /> <NwBreadcrumbItem> <NwBreadcrumbPage v-if="index === trail.length - 1">{{ segment }}</NwBreadcrumbPage> <NwBreadcrumbLink v-else href="#nwbreadcrumb" @click.prevent="depth = index + 1">{{ segment }}</NwBreadcrumbLink> </NwBreadcrumbItem> </template> </NwBreadcrumbList> </NwBreadcrumb> <button v-if="depth < path.length" type="button" class="justify-self-start text-sm text-link underline underline-offset-4" @click="depth = path.length" > Back to hel-01 </button> </div> </NwProvider></template>NwBreadcrumb (nav)└─ NwBreadcrumbList (ol) ├─ NwBreadcrumbItem (li) │ └─ NwBreadcrumbLink (a) | NwBreadcrumbPage | NwBreadcrumbEllipsis └─ NwBreadcrumbSeparator (li)| Part | Prop | Type | Default | Effect |
|---|---|---|---|---|
NwBreadcrumb |
label |
string |
'Breadcrumb' |
aria-label of the navigation landmark |
items |
readonly { label: string; href?: string }[] |
none | Renders the trail from data; the last entry is the current page | |
NwBreadcrumbLink |
href |
string |
none | Link target |
NwBreadcrumbEllipsis |
label |
string |
'More pages' |
Screen-reader text for the collapsed segment |
Each part takes as and as-child, with the defaults shown in the anatomy. NwBreadcrumbPage sets aria-current="page"; separators default to a slash, are aria-hidden with role="presentation", mirror in right-to-left layouts, and accept your own icon in their slot.
NwStepper
Section titled “NwStepper”Progress through ordered steps, wrapping Reka Stepper. The root’s slot exposes nextStep, prevStep, isFirstStep and isLastStep; each item’s slot exposes its state. The indicator shows the step number, then a check once the step is completed.
Allocate the node
Exchange keys
Announce routes
<script setup lang="ts">import { ref } from 'vue'import { NwButton, NwProvider, NwStepper, NwStepperDescription, NwStepperIndicator, NwStepperItem, NwStepperSeparator, NwStepperTitle, NwStepperTrigger,} from '@nyxwire/vue'
const step = ref(2)const stages = [ { title: 'Provision', description: 'Allocate the node' }, { title: 'Peer', description: 'Exchange keys' }, { title: 'Go live', description: 'Announce routes' },]</script>
<template> <NwProvider> <NwStepper v-slot="{ nextStep, prevStep, isFirstStep, isLastStep }" v-model="step" aria-label="Node rollout" class="w-full flex-wrap" > <NwStepperItem v-for="(stage, index) in stages" :key="stage.title" :step="index + 1"> <NwStepperTrigger> <NwStepperIndicator /> <NwStepperTitle as="span">{{ stage.title }}</NwStepperTitle> </NwStepperTrigger> <NwStepperDescription>{{ stage.description }}</NwStepperDescription> <NwStepperSeparator v-if="index < stages.length - 1" /> </NwStepperItem> <div class="flex w-full flex-wrap gap-3 pt-4"> <NwButton variant="ghost" intent="neutral" :disabled="isFirstStep" @click="prevStep" >Previous</NwButton > <NwButton :disabled="isLastStep" @click="nextStep">Next stage</NwButton> </div> </NwStepper> </NwProvider></template>NwStepper└─ NwStepperItem (step; slot: { state }) ├─ NwStepperTrigger │ ├─ NwStepperIndicator (number, or a check when completed) │ └─ NwStepperTitle ├─ NwStepperDescription └─ NwStepperSeparator| Part | Prop | Type | Default | Effect |
|---|---|---|---|---|
NwStepper |
modelValue |
number |
none | Active step, v-model (Reka) |
defaultValue |
number |
1 |
Uncontrolled initial step (Reka) | |
orientation |
'horizontal' | 'vertical' |
'horizontal' |
Layout and arrow-key axis (Reka) | |
linear |
boolean |
true |
Steps must be completed in order (Reka) | |
intent |
NwIntent |
'primary' |
Color of the active and completed indicators | |
items |
readonly (string | NwStepperEntry)[] |
none | Renders one step per entry: a title, or { title, description?, disabled? } |
|
NwStepperItem |
step |
number |
required | Position of the step (Reka) |
disabled |
boolean |
false |
Skips the step (Reka) | |
NwStepperIndicator |
completedLabel |
string |
'Completed:' |
Announced before the title of a completed step |
Keyboard and accessibility. Arrow keys move focus between step triggers, Enter or Space activates one. In a linear stepper a later step cannot be reached before the earlier ones; moving forward marks earlier steps completed. Each trigger is named by its visible indicator and title, so a completed step reads “Completed: Provision”.
NwTree
Section titled “NwTree”A hierarchical list, wrapping Reka Tree. The root flattens your items and hands them to its slot; render one NwTreeItem per entry. NwTreeItem draws a chevron when you pass has-children, a leaf mark otherwise, and indents by level.
- eu-west
- ams-01
- par-02
- eu-north
- Cold standby
<script setup lang="ts">import { ref } from 'vue'import { NwProvider, NwTree, NwTreeItem } from '@nyxwire/vue'
interface Site { name: string children?: Site[]}
const sites: Site[] = [ { name: 'eu-west', children: [{ name: 'ams-01' }, { name: 'par-02' }] }, { name: 'eu-north', children: [{ name: 'hel-01' }, { name: 'sto-01' }] }, { name: 'Cold standby' },]const selected = ref<Site>()const expanded = ref(['eu-west'])</script>
<template> <NwProvider> <div class="grid w-full max-w-sm gap-3"> <NwTree v-slot="{ flattenItems }" v-model="selected" v-model:expanded="expanded" :items="sites" :get-key="(site: Site) => site.name" aria-label="Sites" class="m-0 list-none p-0" > <NwTreeItem v-for="item in flattenItems" :key="item._id" v-bind="item.bind" :has-children="item.hasChildren" > {{ item.value.name }} </NwTreeItem> </NwTree> <output class="text-sm text-fg-muted">Selected: {{ selected?.name ?? 'none' }}</output> </div> </NwProvider></template>NwTree (slot: { flattenItems })└─ NwTreeItem v-for item in flattenItems (v-bind="item.bind", has-children)| Part | Prop | Type | Default | Effect |
|---|---|---|---|---|
NwTree |
items |
T[] |
none | Top-level items (Reka) |
getKey |
(item: T) => string |
required | Unique key of an item (Reka) | |
getChildren |
(item: T) => T[] | undefined |
none | Children of an item; Reka reads children without it |
|
modelValue |
T | T[] |
none | Selection, v-model (Reka) |
|
expanded |
string[] |
none | Keys of open branches, v-model:expanded (Reka) |
|
multiple |
boolean |
false |
Multiple selection (Reka) | |
disabled |
boolean |
false |
Disables the whole tree (Reka) | |
NwTreeItem |
hasChildren |
boolean |
false |
Shows the expand chevron, or a leaf mark when false |
NwTree and NwTreeItem are generic over your item type. The other Reka TreeRoot and TreeItem props and emits pass through.
Keyboard and accessibility. The tree has the tree role and items carry their level. ArrowDown and ArrowUp move, ArrowRight expands a branch (then enters it), ArrowLeft collapses it (or goes to the parent), Enter selects. Name the tree with aria-label.
NwScrollArea
Section titled “NwScrollArea”A scroll container with themed, overlay scrollbars, wrapping Reka ScrollArea. You place the viewport and each scrollbar yourself.
<script setup lang="ts">import { NwProvider, NwScrollArea, NwScrollAreaScrollbar, NwScrollAreaThumb, NwScrollAreaViewport,} from '@nyxwire/vue'
const lines = Array.from({ length: 20 }, (_, index) => ({ id: index + 1, text: ['Handshake ok', 'Route announced', 'Keepalive', 'Peer rekeyed'][index % 4],}))</script>
<template> <NwProvider> <NwScrollArea type="always" class="h-48 w-full max-w-md rounded-md border border-line bg-canvas-subtle" > <NwScrollAreaViewport role="region" aria-label="Relay log" tabindex="0"> <ul class="m-0 list-none divide-y divide-line p-0"> <li v-for="line in lines" :key="line.id" class="px-4 py-2 text-sm text-fg-muted"> <span class="me-3 font-mono tabular-nums text-fg-subtle">{{ String(line.id).padStart(2, '0') }}</span >{{ line.text }} </li> </ul> </NwScrollAreaViewport> <NwScrollAreaScrollbar> <NwScrollAreaThumb /> </NwScrollAreaScrollbar> </NwScrollArea> </NwProvider></template>NwScrollArea├─ NwScrollAreaViewport├─ NwScrollAreaScrollbar (orientation)│ └─ NwScrollAreaThumb└─ NwScrollAreaCorner (when both scrollbars show)| Prop | Type | Default | Effect |
|---|---|---|---|
type |
'auto' | 'always' | 'scroll' | 'hover' | 'glimpse' |
'hover' |
When the scrollbars are visible (Reka) |
scrollHideDelay |
number |
600 |
Delay in ms before scroll and hover bars hide (Reka) |
NwScrollAreaScrollbar takes Reka’s orientation ('vertical' by default).
Keyboard and accessibility. The scrollbars are visual only. Give the viewport role="region", an aria-label and tabindex="0", as in the demo, so it is a named stop in the tab order and the arrow, Page and Home/End keys scroll it.
NwSplitterGroup
Section titled “NwSplitterGroup”Resizable panels, wrapping Reka Splitter. Sizes are percentages of the group unless a panel sets size-unit="px". The handle shows a grip and is a focusable separator.
<script setup lang="ts">import { NwProvider, NwSplitterGroup, NwSplitterPanel, NwSplitterResizeHandle } from '@nyxwire/vue'</script>
<template> <NwProvider> <div class="h-48 w-full rounded-md border border-line"> <NwSplitterGroup direction="horizontal"> <NwSplitterPanel :default-size="35" :min-size="20" class="bg-canvas-subtle p-4" >Relay list</NwSplitterPanel > <NwSplitterResizeHandle label="Resize relay list and topology" /> <NwSplitterPanel :default-size="65" :min-size="20" class="p-4"> Topology map. Focus the grip and use the arrow keys to resize. </NwSplitterPanel> </NwSplitterGroup> </div> </NwProvider></template>NwSplitterGroup (direction)├─ NwSplitterPanel├─ NwSplitterResizeHandle└─ NwSplitterPanel| Part | Prop | Type | Default | Effect |
|---|---|---|---|---|
NwSplitterGroup |
direction |
'horizontal' | 'vertical' |
required | Panels side by side or stacked (Reka) |
keyboardResizeBy |
number | null |
10 |
Arrow-key step (Reka) | |
autoSaveId |
string | null |
null |
Saves the layout in localStorage (Reka) |
|
NwSplitterPanel |
defaultSize |
number |
none | Initial size (Reka) |
minSize |
number |
10 |
Smallest size (Reka) | |
maxSize |
number |
100 |
Largest size (Reka) | |
collapsible |
boolean |
false |
Collapses below minSize to collapsedSize (Reka) |
|
NwSplitterResizeHandle |
label |
string |
'Resize panels' |
aria-label of the separator |
The group and panel emits (@layout, @resize, @collapse, @expand) pass through.
Keyboard. Tab focuses the handle; arrow keys resize the panels by keyboardResizeBy. Name each handle after what it resizes when a page has several.
NwNavbar
Section titled “NwNavbar”A Nyxwire-only application bar: a <nav> landmark with a brand, a row of links and an actions area, underlined by a wire hairline. It is plain markup with no state; the current link gets a wire underline.
<script setup lang="ts">import { ref } from 'vue'import { NwButton, NwNavbar, NwNavbarActions, NwNavbarBrand, NwNavbarLink, NwProvider,} from '@nyxwire/vue'
const sections = ['Relays', 'Routes', 'Audit log']const current = ref('Relays')</script>
<template> <NwProvider class="w-full"> <NwNavbar label="Console"> <template #brand> <NwNavbarBrand href="#nwnavbar">Relay console</NwNavbarBrand> </template> <NwNavbarLink v-for="section in sections" :key="section" href="#nwnavbar" :current="section === current" @click.prevent="current = section" >{{ section }}</NwNavbarLink > <template #actions> <NwNavbarActions> <NwButton size="sm" variant="outline">Sign out</NwButton> </NwNavbarActions> </template> </NwNavbar> </NwProvider></template>NwNavbar (nav)├─ #brand slot → NwNavbarBrand (a)├─ default slot → NwNavbarLink (a, current)└─ #actions slot → NwNavbarActions (div)| Part | Prop | Type | Default | Effect |
|---|---|---|---|---|
NwNavbar |
label |
string |
'Main navigation' |
aria-label of the navigation landmark |
NwNavbarBrand |
href |
string |
none | Link target, usually the home page |
NwNavbarLink |
href |
string |
none | Link target |
current |
boolean |
false |
Sets aria-current="page" and draws the underline |
NwNavbarBrand, NwNavbarLink and NwNavbarActions take as and as-child, so a router link can render them. The bar wraps onto several rows on narrow screens.
Accessibility. Give each navbar a distinct label when a page has several landmarks. Links are ordinary anchors: Tab moves through them and every one shows the focus ring.
NwSidenav
Section titled “NwSidenav”A Nyxwire-only vertical navigation for an application or docs sidebar: a <nav> landmark holding lists of links, optionally split into labelled groups.
<script setup lang="ts">import { ref } from 'vue'import { NwProvider, NwSidenav, NwSidenavGroup, NwSidenavItem, NwSidenavLink, NwSidenavList,} from '@nyxwire/vue'
const groups = [ { label: 'Traffic', links: ['Routes', 'Rate limits', 'Peering'] }, { label: 'Security', links: ['Keys', 'Audit log'] },]const current = ref('Routes')</script>
<template> <NwProvider class="w-full max-w-xs"> <NwSidenav label="Console sections"> <NwSidenavGroup v-for="group in groups" :key="group.label" :label="group.label"> <NwSidenavList> <NwSidenavItem v-for="link in group.links" :key="link"> <NwSidenavLink href="#nwsidenav" :current="link === current" @click.prevent="current = link" >{{ link }}</NwSidenavLink > </NwSidenavItem> </NwSidenavList> </NwSidenavGroup> </NwSidenav> </NwProvider></template>NwSidenav (nav)└─ NwSidenavGroup (label) └─ NwSidenavList (ul) └─ NwSidenavItem (li) └─ NwSidenavLink (a, current)| Part | Prop | Type | Default | Effect |
|---|---|---|---|---|
NwSidenav |
label |
string |
required | aria-label of the navigation landmark |
items |
readonly { href: string; label: string; current?: boolean }[] |
none | Renders a single list from data instead of the default slot | |
NwSidenavGroup |
label |
string |
required | Visible heading that names the group |
NwSidenavLink |
href |
string |
none | Link target |
current |
boolean |
false |
Sets aria-current="page" and highlights the link |
NwSidenavList, NwSidenavItem and NwSidenavLink take as and as-child.
Accessibility. Each group is a role="group" labelled by its visible heading, so screen readers announce “Traffic, group” before its links. The current link carries aria-current="page".
- Every navigation part renders in the page; the navigation menu’s panels use the in-flow viewport, not a portal.
NwScrollAreadraws its own scrollbars, which keeps long lists on themed bars inside panels and HUD layouts; give the area a background.- For touch-heavy layouts, prefer
size="lg"pagination (2.75rem buttons;mdis 2.25rem) and tabs. Accordion triggers are at least 2.75rem tall and tree rows at least 2.25rem.