MorphTooltip
One tooltip for the whole toolbar. It stretches to the next tool and resizes to its label. Navigation.
Open playgroundAbout
MorphTooltip is a React component in the Navigation category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { MorphTooltip } from "@ashutoshswamy/smoui" and set items, className.
Install
npm i @ashutoshswamy/smouiUsage
import { MorphTooltip } from "@ashutoshswamy/smoui";
<MorphTooltip
items={[
{ label: "Move", shortcut: "V", icon: <CursorArrowRaysIcon width={22} height={22} /> },
{ label: "Pen", shortcut: "P", icon: <PencilIcon width={22} height={22} /> },
]}
/>Props 2
- items
Tools. Label and shortcut feed the tooltip and the accessible name.
{ label: string; icon: ReactNode; shortcut?: string; onClick?: () => void }[]- className
Class on the wrapper.
string
More navigation components
- BreadcrumbsA trail that folds its middle into an ellipsis. Press it and the hidden crumbs spring out in order.
- DockIcons swell around the cursor and settle back on a spring.
- FlyoutNavOne panel that follows you. Move between items and it glides sideways and resizes to the new content while the content cross-fades.
- GooMenuA plus that throws its items out as liquid bubbles and fuses them back on close.
- PaginationOne accent pill slides to the page you pick. Long lists fold into ellipses that follow the current page.
- PillNavPill whose highlight stretches toward the item you pick.