DocsComponentsTemplatesThemesGitHub

Tooltip

Short inverted text hint on hover/focus. Never interactive.

Code

import * as React from 'react';
import { IconButton, Tooltip } from '@fruit-labs/design';

export default function Demo() {
  return (
    <div
      style={{
        paddingTop: 40,
      }}
    >
      <Tooltip content="Copy link" shortcut="⌘L" open>
        <IconButton icon="copy" label="Copy link" />
      </Tooltip>
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { Tooltip } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/tooltip.json

Guidelines

  • Use for icon-button names and shortcuts. Rich content: Popover.

Props

PropTypeRequired
contentReact.ReactNodeYes
shortcutstringNo
placement'top' | 'bottom'No
openbooleanNo
childrenReact.ReactNodeYes

Edit this example on GitHub