Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Quick Actions Pill Banner Block for React

A dock pill for a workspace app: a toolbar of four icon buttons (New page, Search, Share, Notifications), each with a tooltip showing its name and its key.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A quick-actions dock for React with Base UI, a compact toolbar for the few things people do all day. A centred capsule sits in a muted shell between the page's rails and holds four ghost icon buttons: New page, Search, Share and Notifications, the last wearing its unread count. Hover or focus on a button shows a tooltip with its name and its key. The pill is a toolbar: one tab stop, and the arrow keys, Home and End move between the buttons. With focus in the dock, the keys in the tooltips press the buttons. A press swaps the icon for a check for a moment and a polite line says what happened: Share copies the page's link and Notifications clears its count. The dock stays one row at every width. It follows your theme. It's built from Guides, Button, Tooltip and Kbd.

FAQ

How does the keyboard work?

The dock is one tab stop: Tab lands on the button you last used (the first one at the start), and the arrow keys move between the four buttons, wrapping at the ends, with Home and End jumping to the first and last. In a right-to-left layout the arrows follow the reading direction. Each button is a real button, so Enter and Space press it, and each has aria-keyshortcuts.

Do the keys in the tooltips work everywhere on the page?

Only while focus is in the dock. A page-wide shortcut such as / or S would fight with your search box, your forms and the browser, so this block scopes them to the toolbar on purpose. To make them global, move the key check from the toolbar's onKeyDown into a keydown listener on the document in an effect, and ignore events from inputs, selects, textareas and anything editable.

What do the buttons do, and how do I wire my own?

Each button runs press with its action's id: New page, Search and Share confirm in place, Share also copies the page's link with navigator.clipboard, and Notifications sets the unread count to 0. Replace the body of press with your own calls (open your search dialog, create the page, open the share sheet) and keep the finish call: it shows the check and speaks the result. The labels and the messages are in the ACTIONS list at the top of the file.

Why do the tooltips not open on a phone?

Tooltips open on hover and keyboard focus, which touch screens don't have, so the dock never depends on them: every button has an accessible name from its label ("Notifications, 3 unread"), and the result of a press is announced and shown as a check. If your audience is mostly on phones, keep the dock to the actions that need no explanation.

How do I pin it to the bottom of the screen?

The dock renders in flow so the preview and a stack of blocks can see it. To float it, add fixed inset-x-4 bottom-4 z-50 mx-auto w-fit to the pill (the div that holds the shell) and remove the block's wrapper padding if the dock lives on its own. Keep room for the home indicator with bottom-[max(1rem,env(safe-area-inset-bottom))].

How do I show a different unread count?

Set UNREAD at the top of the file, or pass your count in as the initial value of the unread state. The badge is a small foreground-coloured circle, hidden at 0, and the button's name follows it ("Notifications, 3 unread", then "Notifications").

  • Pro

    A theme pill for a writing app: a three-way toggle group (Light, System, Dark) seeded from the page's theme, with a label that says which one is on.

  • Pro

    A one-line shortcut hint for a text editor, aligned to the start: three shortcuts read as a sentence, each a key cap and its verb, and a link to the full list.

  • Pro

    A one-line shortcut hint for a docs app: key caps drawn inline that read Command K on a Mac and Ctrl K everywhere else, and an underlined link to all shortcuts.

  • Pro

    An unsaved-changes pill for a form builder: a rolling count of changes, a small Save button and a ghost Discard, settling on a saved or discarded message.

  • Pro

    A documentation search field in a slim bar: an icon, a labelled input and a slash key hint, with a popup of results that filters as you type.

  • Pro

    An install pill for a plant-care app: a greyscale app tile, the name, a row of stars with its score, a small Get link and a dismiss button that folds the block away.