Skip to Content
Kokonut UI

NV-02Navigation

Tool Dock

An editor tool dock with a sliding selection plate, shortcut tooltips and flyouts that you can throw to any edge.

Install with
lucide-react, motion

PROBuilding an editor? Canvas Toolbar is in Kokonut UI Pro

Installation

Tool Dock is a free, open-source React component in the Kokonut UI Navigation collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/toolbar.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/toolbar

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/toolbar.tsx.

npm install lucide-react motion

Usage

import Toolbar from "@/components/kokonutui/toolbar";

export default function Example() {
  return <Toolbar />;
}

Props

tools
DockTool[]Default built-in
value
string

The active tool id, for a controlled dock.

defaultValue
string
onValueChange
(toolId: string) => void
defaultEdge
DockEdgeDefault "bottom"

The edge of the canvas the dock starts on.

onEdgeChange
(edge: DockEdge) => void
shortcuts
"scoped" | "global" | "off"Default "scoped"

When single-key shortcuts work. scoped (default) listens only while focus is inside the canvas, or the pointer is over it and nothing else has focus; global always listens. Never while typing.

ariaLabel
stringDefault "Tools"

Accessible name for the toolbar.

className
string

Classes for the canvas, the box the dock lives in.

dockClassName
string

Classes for the dock itself.

children
ReactNode

Canvas content drawn behind the dock. Defaults to a dot grid.

DockTool

idrequired
string
labelrequired
string
iconrequired
LucideIcon
shortcut
string

A single key that picks this tool, such as "V".

cursor
string

CSS cursor for the canvas while this tool is active.

tools
DockTool[]

Sub-tools, shown in a flyout. The button shows the last one picked.

DockEdge

type DockEdge = "top" | "right" | "bottom" | "left";

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.