Dock
The side rail: a vertical panel pinned to the left or right edge of the shell.
Live demo
Dock is the application's side rail: a flex column pinned to an edge, sized to one of three widths, holding navigation, an inspector, a tool palette, or any other persistent panel. It renders a complementary <aside> by default and a <nav> when nav is set, so a navigation rail carries the right landmark role.
A label names the landmark (applied as aria-label and shown as an optional uppercase header), so multiple docks on a page stay distinguishable to assistive technology. Header, body, and footer parts give the rail a stable internal rhythm; the footer pins to the bottom.
When to use
How this component composes with the rest of the set.
Props
9 props, straight from the manifest.
| Prop | Type | Default | Bindings | Description |
|---|---|---|---|---|
Appearance
Variants
left
Pinned to the left edge with a divider on its right, the default.
right
Pinned to the right edge with the divider on its left.
edge-out
Edge moved to the rail's outer side instead of the inner divider.
edge-bold
A chunky accent spine instead of the default thin edge.
Sizes
sm
Narrow rail, 14rem.
md
Default rail, 18rem.
lg
Wide rail, 22rem.
Anatomy
The named parts that make up the component, with their selectors.
dock
The rail element (an <aside> or <nav>) carrying the side and size classes.
header
The optional uppercase title row, rendered from the label or the header slot.
body
The scrolling content column that holds the rail's items.
footer
The bottom-pinned region, separated by a hairline rule.
Tokens & coverage
What the component consumes, checked live against what the algorithm produces.
Live coverage check against the xoji-default register
(derive(xojiDefault, { anchors }) →
coverComponent(manifest, register)). Every token this component
consumes must be a key the algorithm produces.
--accent
--accent-2
--accent-3
--accent-4
--bg-1
--black
--blue
--border-thick
--border-thin
--brown
--cyan
--danger
--fg-1
--fg-2
--font-sans
--gray
--green
--info
--leading-normal
--leading-tight
--line
--neutral
--orange
--pink
--purple
--red
--space-0
--space-1
--space-2
--space-3
--space-4
--success
--text-body
--text-xs
--warn
--weight-semibold
--white
--yellow
Slots
The rail's content: links, controls, or any panel markup.
Custom header content, overriding the text rendered from label.
Bottom-pinned content, separated by a hairline rule.
Accessibility
Code
Navigation rail and inspector
A left navigation <nav> and a right complementary inspector, each named for assistive tech.
<xoji-dock label="Navigation" nav side="left">
<a href="/dashboard">Dashboard</a>
<a href="/projects">Projects</a>
<a href="/settings">Settings</a>
</xoji-dock>
<xoji-dock label="Inspector" side="right" size="sm">
<p>Properties for the selected item appear here.</p>
<small slot="footer">Last saved a moment ago.</small>
</xoji-dock>
<script lang="ts">
import { Dock } from "@xoji/svelte";
</script>
<Dock label="Navigation" nav side="left">
<a href="/dashboard">Dashboard</a>
<a href="/projects">Projects</a>
<a href="/settings">Settings</a>
</Dock>
<Dock label="Inspector" side="right" size="sm">
<p>Properties for the selected item appear here.</p>
{#snippet footer()}
<small>Last saved a moment ago.</small>
{/snippet}
</Dock>
---
import { Dock } from "@xoji/astro";
---
<Dock label="Navigation" nav side="left">
<a href="/dashboard">Dashboard</a>
<a href="/projects">Projects</a>
<a href="/settings">Settings</a>
</Dock>
<Dock label="Inspector" side="right" size="sm">
<p>Properties for the selected item appear here.</p>
<small slot="footer">Last saved a moment ago.</small>
</Dock>