Skip to content

pastetaste

Action Dock

NavigationForms

Floating dock with a real search field (press / to focus, live result count, results panel that grows upward), a row of destinations and one accent action button.

Paste it into Claude Code: it installs the component, asks for your brand and content, and places it on the page you name.

Install

Or by hand, in a Next.js project with shadcn set up. It writes components/pastetaste/action-dock.tsx.

npx shadcn@latest add https://pastetaste.com/r/action-dock.json

Prompt

Install the pastetaste component "Action Dock" (action-dock) into this Next.js project and use it.

What it is: Floating dock with a real search field (press / to focus, live result count, results panel that grows upward), a row of destinations and one accent action button.

Before you place it, ask me (one short message, in my language; "skip" = sensible default): which page and section it goes in, my brand colour (hex), the text, labels or images it should show, and whether I want my logo or my own copy in the demo content. Then:

Steps:
1. If the project has no components.json, run: npx shadcn@latest init -y -d. Then run: npx shadcn@latest add https://pastetaste.com/r/action-dock.json
   (it writes components/pastetaste/action-dock.tsx; install any npm packages it reports).
2. Import it: import { ActionDock } from "@/components/pastetaste/action-dock" (check the file for the exact named export).
3. Put it where it fits on the page I name, keep the rest of the page untouched, and pass props for my colours instead of editing the installed file.
4. It does not depend on Tailwind; colours come from CSS variables (--pt-*) or props.
5. It supports prefers-reduced-motion with a still state; do not remove it.

Props (all optional unless the type has no default):
- items: { id: string; label: string; icon: ReactNode; href?: string; badge?: boolean | number }[] — Destinations. The action button sits in the middle, after the first half of the items.
- action: { label: string; icon: ReactNode; onPress?: () => void; href?: string } — The primary action, drawn as the one accent pill. label is its accessible name.
- value: string — Active destination id for controlled use.
- defaultValue: string = items[0].id — Starting destination when uncontrolled.
- onChange: (id: string, item: DockItem) => void — Called when a different destination is chosen.
- query: string — Search text for controlled use; pair it with onQueryChange.
- onQueryChange: (query: string) => void — Called on every keystroke, and when the field is cleared.
- results: number | string — Result count shown in brackets at the right of the field while there is a query.
- panel: ReactNode — Results panel inside the dock; it opens while the dock has focus and the query is not empty. Arrow Down moves into it.
- tone: 'paper' | 'ink' = 'paper' — White dock or black dock.
- accent: string = var(--pt-accent, #ff4a2e) — The one accent: action button, focus ring and result count.
- shortcut: boolean = true — Press / anywhere outside a field to focus the search.

Live preview: https://pastetaste.com/c/action-dock
Then run the dev server, check it in the browser at desktop and mobile width, and tell me the page URL.

Props 12

PropTypeDefaultDescription
items{ id: string; label: string; icon: ReactNode; href?: string; badge?: boolean | number }[]-Destinations. The action button sits in the middle, after the first half of the items.
action{ label: string; icon: ReactNode; onPress?: () => void; href?: string }-The primary action, drawn as the one accent pill. label is its accessible name.
valuestring-Active destination id for controlled use.
defaultValuestringitems[0].idStarting destination when uncontrolled.
onChange(id: string, item: DockItem) => void-Called when a different destination is chosen.
querystring-Search text for controlled use; pair it with onQueryChange.
onQueryChange(query: string) => void-Called on every keystroke, and when the field is cleared.
resultsnumber | string-Result count shown in brackets at the right of the field while there is a query.
panelReactNode-Results panel inside the dock; it opens while the dock has focus and the query is not empty. Arrow Down moves into it.
tone'paper' | 'ink''paper'White dock or black dock.
accentstringvar(--pt-accent, #ff4a2e)The one accent: action button, focus ring and result count.
shortcutbooleantruePress / anywhere outside a field to focus the search.
View all →