Oola Dock
VdDock places navigation on any screen edge and animates between horizontal and vertical layouts. Use the customizer to try placement, tint, radius, and glass strength.
This demo cycles all four edges and allows vertical placement on narrow screens. The package pairs bottom/left and top/right, and uses a horizontal edge at 520px or below. Replace the #brand slot with your logo.
Live customizer
Page-local knobs bound to real VdDock props — they do not write the site theme. Click ū (or your chosen brand) to cycle bottom → left → top → right. The brand mark spins on hover and while the dock morphs. Auto layout shows labels on horizontal edges and icon-only items on vertical edges. Full screen expands this playground only (not the browser).
Open Color tints
Surface vs accent tint
tintMode decides what :tint paints. surface (the default, left) washes the pill itself. accent (right) holds the pill at constant ink and uses --vd-dock-tint to color the active item icon and the #brand slot while the glass stays neutral. That is what this site's own dock uses — chrome that sits over changing page content reads better when only the icons move with the theme.
Fixed app chrome
position="fixed" pins to the viewport like oolasite. Default edge is placement="bottom". Offset your main with --vd-dock-height and --vd-dock-inset. Use :menu="false" on VdThemeSwitcher so the menu cannot clip under the pill.
VdDock API
| Prop / slot | Notes |
|---|---|
v-model:orientation | "horizontal" | "vertical". Brand click morphs through a square waypoint (377ms / 610ms) on the current pair. |
v-model:placement | "bottom" | "top" | "left" | "right" (default bottom). Source of truth for the edge. Pairs: bottom ↔ left, top ↔ right. |
:position | "fixed" (viewport chrome, default) | "contained" (absolute in a relative parent — use this in docs and cards). Fixed docks force a horizontal edge at ≤520px; this playground lifts that JS lock. |
:dark | Always-dark near-black frost (default true). |
:tint | Optional Open Color wash: red | orange | yellow | green | teal | blue | violet | pink. |
:tintMode | "surface" (default) paints the pill with :tint. "accent" holds the pill at constant ink and colors the active item icon and the #brand slot through --vd-dock-tint. No effect without :tint. |
:glass | Seemore step 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 (default 34). |
:radius | Dock-own scale — not theme RadiusOption (max 0.5). 0.5 | 0.75 | 1 | 1.25 (default) | 1.5 | 2 | 9999 (pill). Sets --vd-dock-radius. |
:itemLayout | "stack" icon-above-label (default) | "inline" icon-then-label | "auto" (inline on horizontal edges, icon-only stack with tooltips on vertical edges). |
:brandSpin | boolean (default false). Wraps #brand in .vd-dock-brand-spin and continuously spins it on hover, focus, and while morphing, then eases back upright to 0deg. |
:brandCorner | "mirror" (default, flips brand to the far corner on top/right edges) | "consistent" (keeps brand at the leading left/top corner on every edge). |
:brandToggles | Brand click toggles the paired edge (default true). The package disables this at ≤520px on fixed chrome; this playground opts out. |
:cycle | "pair" (default) keeps bottom ↔ left / top ↔ right. "edges" walks bottom → left → top → right → bottom. This playground uses edges. |
:persist | Opt-in. Writes getStoragePrefix() + "dock-orient" as the placement string. Default false. |
:storageKey | Custom localStorage key when :persist="true" (defaults to getStoragePrefix() + "dock-orient"). |
:label | aria-label for the nav (default "Primary"). |
#brand | Morph-origin corner. Demos use ū; swap any icon or wordmark. Bottom/left: brand left or bottom. Top/right: brand right or top (unless brandCorner="consistent"). |
default | Items — VdDockItem or any .vd-dock-item. |
#actions | Trailing controls (e.g. VdThemeCustomizer variant="swatches" and VdThemeSwitcher :menu="false"). |
VdDockItem API
| Prop | Notes |
|---|---|
:icon | Phosphor name via VdIcon. Omit for a label-only item. |
:label | Visible label and accessible name. |
:active | Adds .is-active and aria-current="page". |
:activeIconFill | boolean (default true). Renders the filled Phosphor icon variant when :active is true. |
:tooltip | string | boolean. When true, uses :label; when a string, uses that custom text; when omitted inside a dock with itemLayout="auto", automatically shows :label on vertical edges (left/right) using the .vd-tooltip-dock variant. |
:badge | string | number. Optional notification badge rendered in .vd-dock-badge. |
:href | string. When set, renders an <a> link instead of a <button> (unless overridden by :as). |
:as | string. Custom element or component tag (defaults to "a" when :href is passed, otherwise "button"). |
Dock items with tooltips automatically apply data-tooltip-variant="dock" (styled by .vd-tooltip-dock) and position the bubble away from the active dock edge.
useDockOrientation & useDockBrandSpin API
useDockOrientation(options?)
| Member | Notes |
|---|---|
Options | UseDockOrientationOptions: { narrowQuery?: string, persist?: boolean, storageKey?: string, initial?: DockOrientation, initialPlacement?: DockPlacement }. |
State refs | placement (Ref<DockPlacement>), orientation (Ref<DockOrientation>), visualPhase (Ref<'horizontal' | 'square' | 'vertical'>), isMorphing (Ref<boolean>), isNarrow (Ref<boolean>). |
Computed helpers | dockClasses (is-horizontal, is-square, is-vertical, is-morphing, vd-dock-edge-*), orientClass, brandLabel, brandPressed, canToggle. |
Methods | toggle(), playTo(orientation), playToPlacement(placement, { interrupt? }), snapTo(orientation), snapToPlacement(placement). |
Exported helpers & constants | dockOrientationOf(placement), dockHorizontalOf(placement), dockPlacementOf(orientation, from), DOCK_PLACEMENTS, DOCK_PLACEMENT_PAIR, DOCK_MORPH_MS, DOCK_NARROW_QUERY, DOCK_ORIENT_SUFFIX, DOCK_TINTS, DOCK_TINT_MODES, DOCK_GLASS_STEPS, DOCK_RADIUS_OPTIONS. |
useDockBrandSpin(dockEl, enabled)
| Member | Notes |
|---|---|
useDockBrandSpin(dockEl, enabled) | Composable that observes .vd-dock-brand pointer/focus events and dock .is-morphing state to animate .vd-dock-brand-spin via Web Animations API. |
ensureDockBrandSpin(spinEl, durationMs) | Starts or updates a continuous 360deg rotation on --vd-dock-brand-angle from the current angle. |
settleDockBrandSpin(spinEl, reducedMotion?) | Coasts the brand mark from its current --vd-dock-brand-angle back to 0deg upright (or snaps immediately when reducedMotion is true). |
Constants | DOCK_BRAND_ANGLE_VAR (--vd-dock-brand-angle), DOCK_SPIN_HOVER_MS (5000), DOCK_SPIN_MORPH_MS (900), DOCK_SPIN_SETTLE_MIN_MS (600), DOCK_SPIN_SETTLE_MAX_MS (1800). |
Accessibility
- Renders a semantic
<nav :aria-label="label">landmark (defaults to"Primary"). - Active
VdDockItemelements setaria-current="page"and always carry:aria-label="label"so icon-only vertical docks remain fully labeled for screen readers. - The
#brandcorner button exposes:aria-pressed="brandPressed"(true when vertical), an orientation-awarearia-label("Use vertical dock"/"Use horizontal dock"), andaria-disabled="true"when toggling is disabled or locked on narrow viewports. - Honors
prefers-reduced-motion: reduce: orientation changes skip the square morph timers viasnapToPlacement(), andsettleDockBrandSpin()immediately snaps--vd-dock-brand-angleto0deg.