MorphTooltip

One tooltip for the whole toolbar. It stretches to the next tool and resizes to its label. Navigation.

Open playground
MoveVFrameFPenPTextTCommentC

About

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

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
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