Componentnavigation2.34 KB gzipZero dependencies

Dock

Floating application dock bar with hover magnification and active indicators.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add dock

Or install the full npm package:

npm install bigbullui

Usage

tsx6 lines
import { Dock, DockItem } from "@/components/ui/dock"; <Dock>  <DockItem label="Home" onClick={() => {}} />  <DockItem label="Search" onClick={() => {}} /></Dock>

Source code

dock.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxdock.tsx438 lines
"use client"; import * as React from "react";import { cn, isSafeUrl } from "./lib/utils"; export interface DockContextValue {  mouseX: number | null;  mouseY: number | null;  orientation: "horizontal" | "vertical";  direction: "bottom" | "top" | "left" | "right";  magnification: number;  distance: number;  iconSize: number;  magnify: boolean;} const DockContext = React.createContext<DockContextValue>({  mouseX: null,

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { useDock } from "@/components/ui/dock"; <useDock />
PropTypeDescription
childrenReact.ReactNodeChild elements rendered inside the component.
itemsDockItemData[]Structured list of items rendered by the component.
orientation"horizontal" | "vertical"Layout and keyboard navigation axis. (Default: "horizontal")
direction"bottom" | "top" | "left" | "right"Configures direction. (Default: "bottom")
magnificationnumberConfigures magnification. (Default: 1.45)
distancenumberConfigures distance. (Default: 130)
iconSizenumberConfigures icon size. (Default: 44)
magnifybooleanToggles magnify. (Default: true)
showNotchesbooleanToggles show notches. (Default: true)
serialNumberstringConfigures serial number. (Default: "STUB // DOCK")
classNamestringOptional Tailwind or custom CSS classes merged with component styles.