DockPro
A floating tool dock: a label glides between items, a tint springs to the chosen tool, groups grow a tray and items reorder with Alt + arrows.
oxyn add dockThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- Tools or modes switched all day: canvas tools, agent views, quick actions.
When not to use
- The app frame: use App shell instead.
- A main action with a menu of alternatives: use Split button instead.
- An app sidebar: use Sidebar instead.
Installation
Dock is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add dockUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Tools
A canvas tool dock with a group tray.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Magnify
macOS-style magnify (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Vertical
Vertical dock on the left edge (Oxyn plus).
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Dock
| Prop | Type | Default | Description |
|---|---|---|---|
itemsrequired | Vec<DockItem> | — | Items. |
value | Option<String> | Default::default() | Selected id. |
label | String | "Tools" | Toolbar label. |
magnify | bool | Default::default() | Magnify on hover. |
reorder | bool | Default::default() | Allow Alt + arrows to reorder. |
position | String | "bottom" | `bottom` · `left`. |
on_change | EventHandler<String> | — | Chosen. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| ← → | Along the dock (or inside a tray) |
| EnterorSpace | Choose; on a group, toggle its tray |
| ↑ | Open a group's tray |
| ↓orEscape | Close the tray |
| Alt← → | Move the focused item |
Accessibility
- toolbar with roving tabindex; plain items use aria-pressed.
- Groups have aria-haspopup, aria-expanded and aria-controls; closed trays are inert.
- Names include the shortcut and badge (“Pen, P”).
From the spec
toolbar with roving focus; names include shortcut and badge (“Pen, P”; “Shapes: Ellipse, O, selected”).
Motion & interaction
A label glides between items on hover and focus; the tint springs to the chosen item; a group’s glyph crossfades when its member changes; trays grow out of the dock with members staggering in.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Label | 120 ms fade | linear | instant |
| Tint | 260 ms | overshoot | instant |
| Tray | 220 ms + 30 ms stagger | ease.out | instant |
Responsive behaviour
- The floating label shows on hover and focus, not touch.
Edge cases (spec)
Labels never show on touch. Closed trays are inert. Reorder keeps an open tray attached to its group.
Notes for AI
- Import
Dockfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
DockElinoxyn_gpui. - Props to set first:
items. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.