The following props are available for tooltip component. These are the custom props that come with we've added for the tooltip component and you can use all the other native props as well.
Attribute | Type | Description | Default |
---|---|---|---|
open | boolean | Makes the tooltip open, when tooltip is controlled | undefined |
handler | function | Change open state for controlled tooltip | undefined |
content | node | Add content for tooltip | undefined |
interactive | boolean | Make tooltip interactive | false |
placement | Placement | Change tooltip placement | top |
offset | Offset | Change tooltip offset from it's handler | 5 |
dismiss | Dismiss | Change dismiss listeners when clicking outside | undefined |
animate | Animate | Change tooltip animation | undefined |
className | string | Add custom className for tooltip | '' |
children | node | The element that tooltip will reference to | No default value it's a required prop. |
import type { TooltipProps } from "@material-tailwind/react";
type placement =
| "top"
| "top-start"
| "top-end"
| "right"
| "right-start"
| "right-end"
| "bottom"
| "bottom-start"
| "bottom-end"
| "left"
| "left-start"
| "left-end";
type offset =
| number
| {
mainAxis?: number;
crossAxis?: number;
alignmentAxis?: number | null;
};
type dismissType = {
enabled?: boolean;
escapeKey?: boolean;
referencePointerDown?: boolean;
outsidePointerDown?: boolean;
ancestorScroll?: boolean;
bubbles?: boolean;
};
type animate = {
mount?: object;
unmount?: object;
};