Class: Tooltip
Defined in: src/betterdiscord/ui/tooltip.ts:22
Constructors
Constructor
new Tooltip(
node: HTMLElement,
text:
| string
| HTMLElement,
options: TooltipOptions): Tooltip;Defined in: src/betterdiscord/ui/tooltip.ts:44
Creates a tooltip that shows when hovering over the given node.
Parameters
| Parameter | Type | Description |
|---|---|---|
node | HTMLElement | DOM node to monitor and show the tooltip on |
text | | string | HTMLElement | - |
options | TooltipOptions | additional options for the tooltip |
Returns
Tooltip
Properties
active
active: boolean;Defined in: src/betterdiscord/ui/tooltip.ts:29
disabled
disabled: boolean;Defined in: src/betterdiscord/ui/tooltip.ts:28
element
element: HTMLDivElement;Defined in: src/betterdiscord/ui/tooltip.ts:30
label
label:
| string
| HTMLElement;Defined in: src/betterdiscord/ui/tooltip.ts:24
labelElement
labelElement: HTMLDivElement;Defined in: src/betterdiscord/ui/tooltip.ts:32
node
node: HTMLElement;Defined in: src/betterdiscord/ui/tooltip.ts:23
observer?
optional observer: MutationObserver;Defined in: src/betterdiscord/ui/tooltip.ts:33
preventFlip
preventFlip: boolean;Defined in: src/betterdiscord/ui/tooltip.ts:27
side
side: "top" | "right" | "bottom" | "left";Defined in: src/betterdiscord/ui/tooltip.ts:26
style
style: "warn" | "info" | "success" | "danger" | "primary";Defined in: src/betterdiscord/ui/tooltip.ts:25
tooltipElement
tooltipElement: HTMLDivElement;Defined in: src/betterdiscord/ui/tooltip.ts:31
Accessors
canShowAbove
Get Signature
get canShowAbove(): boolean;Defined in: src/betterdiscord/ui/tooltip.ts:83
Boolean representing if the tooltip will fit on screen above the element
Returns
boolean
canShowBelow
Get Signature
get canShowBelow(): boolean;Defined in: src/betterdiscord/ui/tooltip.ts:85
Boolean representing if the tooltip will fit on screen below the element
Returns
boolean
canShowLeft
Get Signature
get canShowLeft(): boolean;Defined in: src/betterdiscord/ui/tooltip.ts:87
Boolean representing if the tooltip will fit on screen to the left of the element
Returns
boolean
canShowRight
Get Signature
get canShowRight(): boolean;Defined in: src/betterdiscord/ui/tooltip.ts:89
Boolean representing if the tooltip will fit on screen to the right of the element
Returns
boolean
container
Get Signature
get container(): Element;Defined in: src/betterdiscord/ui/tooltip.ts:81
Container where the tooltip will be appended.
Returns
Methods
centerHorizontally()
centerHorizontally(): void;Defined in: src/betterdiscord/ui/tooltip.ts:173
Returns
void
centerVertically()
centerVertically(): void;Defined in: src/betterdiscord/ui/tooltip.ts:178
Returns
void
hide()
hide(): void;Defined in: src/betterdiscord/ui/tooltip.ts:92
Hides the tooltip. Automatically called on mouseleave.
Returns
void
show()
show(): void;Defined in: src/betterdiscord/ui/tooltip.ts:100
Shows the tooltip. Automatically called on mouseenter. Will attempt to flip if position was wrong.
Returns
void
showAbove()
showAbove(): void;Defined in: src/betterdiscord/ui/tooltip.ts:146
Force showing the tooltip above the node.
Returns
void
showBelow()
showBelow(): void;Defined in: src/betterdiscord/ui/tooltip.ts:153
Force showing the tooltip below the node.
Returns
void
showLeft()
showLeft(): void;Defined in: src/betterdiscord/ui/tooltip.ts:160
Force showing the tooltip to the left of the node.
Returns
void
showRight()
showRight(): void;Defined in: src/betterdiscord/ui/tooltip.ts:167
Force showing the tooltip to the right of the node.
Returns
void
create()
static create(
node: HTMLElement,
text:
| string
| HTMLElement,
options: TooltipOptions): Tooltip;Defined in: src/betterdiscord/ui/tooltip.ts:78
Alias for the constructor
Parameters
| Parameter | Type |
|---|---|
node | HTMLElement |
text | | string | HTMLElement |
options | TooltipOptions |
Returns
Tooltip