Tooltip
caution
All props/parameters are optional unless they are marked with an asterisk ( * ).
Example
import { components } from "replugged";
const { Tooltip } = components;
<Tooltip text="Tooltip text">{/* Your components here */}</Tooltip>;
Enums
Enum | Description |
---|---|
Tooltip.Aligns | Tooltip alignments TOP | CENTER | BOTTOM | LEFT | RIGHT |
Tooltip.Colors | Tooltip colors PRIMARY | BLACK | GREY | BRAND | GREEN | YELLOW | RED | CUSTOM | PREMIUM |
Tooltip.Positions | Tooltip positions TOP | BOTTOM | LEFT | RIGHT | CENTER | WINDOW_CENTER |
Props
Name | Type | Default | Description |
---|---|---|---|
align | Tooltip.Aligns | Tooltip.Aligns.CENTER | Tooltip alignment to the children; works together with position |
allowOverflow | boolean | false | Whether the tooltip content can overflow |
className | string | Component class name | |
clickableOnMobile | boolean | true | Whether the tooltip shows up on click if app is in mobile view |
color | Tooltip.Colors | Tooltip.Colors.PRIMARY | Sets color of the tooltip |
delay | number | How long the tooltip takes to appear in milliseconds | |
disableTooltipPointerEvents | boolean | false | Whether to disable pointer events on the tooltip |
forceOpen | boolean | false | Whether the tooltip is always visible |
hideOnClick | boolean | true | Whether the tooltip hides after clicking anywhere |
onAnimationRest | (result: unknown, spring: unknown, item?: unknown) => void | Function ran when the tooltip is animating; its parameters are related to react-spring | |
onTooltipShow | () => void | Function ran when the tooltip shows up | |
position | Tooltip.Positions | Tooltip.Positions.TOP | Tooltip position; works together with align |
shouldShow | boolean | true | Whether the tooltip can show |
spacing | number | 8 | Distance from the children |
style | CSSProperties | Component style | |
text | * string | Tooltip text | |
tooltipClassName | string | Tooltip element class name | |
tooltipContentClassName | string | Tooltip content element class name |