Skip to content
Calm motion: animations on this site only fade, with no movement

Dock ​

A strip of app icons that swell under the pointer

A row (or column) of big icon buttons for the handful of places someone returns to: an app launcher, a pinned set of tools, a mobile-style home bar. The icon under the pointer grows and its neighbors follow. The label appears above. For the main navigation of a site use NavigationMenu or BottomTabs, which carry text.

Bottom and side

Opened: nothing yet

  • items are { id, label, icon?, href?, badge?, disabled? }. An item with href is a link, the rest are buttons. select fires on click. icon is a character or emoji: the #item slot draws an image or Icon instead.
  • It is a toolbar with one tab stop. The arrow keys move along the dock (← → on the bottom, ↑ ↓ on the sides, mirrored under RTL). Home and End jump to the first and last item. Disabled buttons are skipped. label names every item, so the growing and the tooltip are decoration. A keyboard-focused item grows as well.
  • position is the edge it sits on: it sets the direction, where icons grow from and which arrows work. magnification (1.6) is how much the nearest icon grows, radius the reach in px. :magnification="1" turns it off. Touch never magnifies, and nor does prefers-reduced-motion.
  • Growth is a transform, so nothing around the dock moves.

Usage ​

ts
import { BlessDock } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
items*BlessDockItem[]—
position"left" | "bottom" | "right""bottom"the screen edge it sits on: sets the direction it lays out, grows and is navigated in
sizenumber44px, the resting size of an icon
magnificationnumber1.6how much the icon under the pointer grows; 1 turns the effect off
radiusnumber110px of reach either side of the pointer
labelstring"Dock"

Events

NamePayloadDescription
select[item: BlessDockItem]

Slots

NameScopeDescription
item{ item: BlessDockItem; }

Released under the MIT License. Character names and artwork belong to their owners.