Selection toolbar
Actions for the words you selected, where you selected them: the toolbar grows out of the selection and leaves with it; Alt+T reaches it from the keyboard.
Ostra wants intercompany in scope for the first quarter. The security review is the last item before signature, and João has asked for the order form to arrive before the board meets on the 24th.
Select text, then press Alt+T for actions.Last edited by Priya Nair at 10:42
When to use
- Comment, highlight or link on documents and transcripts.
- Quoting part of a message.
When not to use
- Rich text editing; use the editor's own toolbar.
Installation
terminal
pnpm dlx shadcn@latest add @caliper/selection-toolbar
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
SelectionToolbar
4 props
PropTypeDefault
container *RefObject<HTMLElement | null>—
actions *readonly SelectionAction[]—
labelstring"Selection"
classNamestring—
Keyboard
- Escape
- Closes or cancels, then returns focus to where it came from.
- →
- Moves to the next item or value.
- ←
- Moves to the previous item or value.
Accessibility
It exposes toolbar semantics, with aria-label and aria-hidden kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/selection-toolbar.mdThe index of every part is at /llms.txt.
More in Surfaces
Push buttonA chunky button with visible depth: the face sits on its own edge, lifts a pixel on hover, travels down onto the edge when pressed and springs back when let go. For playful flows such as onboarding, lessons and rewards.RippleInk that spreads from where a surface is pressed. Drop it inside anything pressable; it listens to its parent. A held press keeps the ink until release, and Enter or Space start it from the centre.BoopGives an icon a small springy nudge when the control around it is hovered or focused, then lets it settle back on its own even if the pointer stays: a bell rings, a cog turns, an arrow leans forward.