Dropdown (extends Tooltip)
Assign a floater panel to a MouseEvent
Example
Syntax
new Dropdown({
content: createElement({
class: 'bg-white pad',
content: 'Hello World'
}),
anchor: '#hi-button'
})
HTML
<komp-dropdown anchor="#hi-button">
Hello World
</komp-dropdown>
Options
types | description | required | default | |
---|---|---|---|---|
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 |
||
mouseevent
|
String |
MouseEvent that toggles floater |
click |