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.jsonGuidelines
- Use for icon-button names and shortcuts. Rich content: Popover.
Props
| Prop | Type | Required |
|---|---|---|
content | React.ReactNode | Yes |
shortcut | string | No |
placement | 'top' | 'bottom' | No |
open | boolean | No |
children | React.ReactNode | Yes |