Skip to content

BaseTooltipBox

Component to display a tooltip for additional content e.g.: quick actions

Props

Prop nameDescriptionTypeValuesDefault
attachToHTMLElement to attach the tooltip
e.g.: vue ref element
null-
directionOrderdefine the default direction orderarray-['top', 'bottom', 'right', 'left']
stylesadd additional styling
caveat: properties top, left and right will be overwritten due position calculation
object-{}
modalTitletitle of the modal popup on mobile
if more customisation is needed, use the slot header-title instead
string-''
typeOnMobilespecify how the component is rendered on mobile resolutions

box: component is rendered at the attachTo HTMLElement
modal: component is rendered as a modal popup
fullscreen: component is rendered as ap popup with max height and width
stringbox, fullscreen, modal'modal'
thresholdTopspecify a threshold value in px for the box top position calculation
Useful to prevent top alignment of the TooltipBox, for example, when there is a fixed-positioned header (BaseHeader).

Note: The value can also be set globally with the CSS variable --base-tooltip-box-threshold-top.
The property will be overwritten by the CSS variable.
number-0
headerIdcustomise the tooltipBox id
if you are using the header-title slot this should also be set as id on your custom title element
(it is also available via slot binding)
string|number-'popup-title'
descriptionElementIdspecify the id of the element containing a description - for accessibility onlystring-'popup-body'
overlayBackgroundVisibledefine if the overlay background should be visible
(semitransparent black) - this only applies to typeOnMobile 'modal'
boolean-false
mobileSizedefine a custom size (in px) when the component should switch to mobile viewnumber-640
initialFocusElementHTMLElement to focus after opening the tooltip
Note: If empty, the header title will be focused by default.
If using the slot for a custom header, be sure to
define an id attribute with the value headerId
The value should be a valid CSS selector.
string-''
focusableElementslist of focusable HTML elements using tab key navigationarray-['a[href]', 'button:enabled', 'input:enabled', '*[tabindex]:not([tabindex="-1"])']
disableTabKeyHandlerspecify to disable the tab key handler within the componentboolean-false
clickOutsideOptionsspecify options for the click-outside handler
https://vueuse.org/core/onClickOutside/#type-declarations
object-{
capture: false
}

Events

Event namePropertiesDescription
closeundefined boolean - the updated stateEvent emitted when close button is clicked or clicked-outside is triggered

Slots

NameDescriptionBindings
header-titlecustomize the header displayed on mobile for typeOnMobile modal and fullscreenheader-id string, number - bind this id to your slot element containing the title text for assistive technology to work properly
defaultslot to inject box content

Demo

Demo with BaseImageBoxes