GitHub

Tooltip Button

A button, usually icon-only, whose tooltip also gives it an accessible name.

Loading example…

Installation

pnpm dlx shadcn@latest add @sui/tooltip-button

Install with the shadcn CLI or use the shared @workspace/ui package. Follow the installation guide to configure the registry, load styles, and choose import aliases.

import { TooltipButton } from "@workspace/ui/components/tooltip-button";

Usage

<TooltipButton variant="ghost" size="icon-sm" tooltip="Bold">
  <Bold />
</TooltipButton>

tooltip is shown on hover and focus through Tooltip and is also the button's aria-label, so icon-only buttons are named once. All other Button props pass through, including glass. Toolbars in Code Editor and the Image preview are built from it.

API reference

PropTypeDefault / behavior
tooltipstringRequired; tooltip text and accessible name.
Button propsPassed to the Button.

The module exports TooltipButtonProps.