Componentnavigation2.34 KB gzipZero dependencies
Dock
Floating application dock bar with hover magnification and active indicators.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add dockOr install the full npm package:
npm install bigbulluiUsage
tsx6 lines
import { Dock, DockItem } from "@/components/ui/dock"; <Dock> <DockItem label="Home" onClick={() => {}} /> <DockItem label="Search" onClick={() => {}} /></Dock>Source code
dock.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| children | React.ReactNode | Child elements rendered inside the component. |
| items | DockItemData[] | 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") |
| magnification | number | Configures magnification. (Default: 1.45) |
| distance | number | Configures distance. (Default: 130) |
| iconSize | number | Configures icon size. (Default: 44) |
| magnify | boolean | Toggles magnify. (Default: true) |
| showNotches | boolean | Toggles show notches. (Default: true) |
| serialNumber | string | Configures serial number. (Default: "STUB // DOCK") |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |