Tooltip (extends Floater)
Assign a message to show on hover.
Example
Syntax
new Tooltip({
content: "Hello World",
anchor: '#hi-button'
})
HTML
<komp-tooltip anchor="#hi-button">
Hello World
</komp-tooltip>
Options
| types | description | required | default | type | |
|---|---|---|---|---|---|
content
|
String, HTMLElement, Array, Object |
content for the floater, uses Dolla's |
|||
anchor
|
String, HTMLElement |
element to append floater to. If |
true | null/anchor.parentElement | |
placement
|
String |
how the floater is anchored options like "top", "top-start", "top-end", "left", "left-start"... |
bottom | ||
strategy
|
String |
how the floater is positioned in the document. "absolute" or "fixed" |
absolute | ||
flip
|
Boolean, Object |
See https://floating-ui.com/docs/flip, defaults to false in favor of autoPlacement |
false | ||
offset
|
Boolean, Object | false | |||
shift
|
Boolean, Object | true | |||
arrow
|
Boolean, Number |
True to show default size, or number in pixels |
false | ||
size
|
Boolean, Object | false | |||
autoPlacement
|
Boolean, Object | true | |||
inline
|
Boolean, Object | false | |||
autoUpdate
|
Boolean, Object | true | |||
removeOnBlur
|
Boolean |
hide floater on outside click/focus or escape key |
false | ||
timeout
|
Number |
ms to wait until hiding after mouseout |
300 | ||
onHide
|
Function |
called after hidden |
|||
onShow
|
Function |
called before showing |
|||
scope
|
showing a tooltip will hide all other tooltips of same scope |
general | String | ||
enabled
|
set starting state |
true | boolean |