pastetaste
Action Dock
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.
Live demo. Move the mouse and scroll inside it.
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.jsonPrompt
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
| Prop | Type | Default | Description |
|---|---|---|---|
| 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. |