Skip to main content English Español Claro Oscuro Sistema

Tooltip

<gstock-tooltip> | GstockTooltip

API

Propiedades

Nombre Descripción Reflects Tipo Por defecto
content The tooltip’s content. If you need to display HTML, use the content slot instead. string ''
disabled Disables the tooltip so it won’t show when triggered. Reflects boolean false
distance The distance in pixels from which to offset the tooltip away from its target. number 8
hoist Enable this option to prevent the tooltip from being clipped when the component is placed inside a container with overflow: auto|hidden|scroll. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios. boolean false
open Indicates whether or not the tooltip is open. You can use this in lieu of the show/hide methods. Reflects boolean false
placement The preferred placement of the tooltip. Note that the actual placement may vary as needed to keep the tooltip inside of the viewport. 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' 'top'
skidding The distance in pixels from which to offset the tooltip along its target. number 0
color Color of the tooltip. 'primary' | 'secondary' | 'information' 'primary'
trigger Controls how the tooltip is activated. Possible options include click, hover, focus, and manual. Multiple options can be passed by separating them with a space. When manual is used, the tooltip must be activated programmatically. string 'hover focus'
updateComplete

A read-only promise that resolves when the component has finished updating.

Aprende más sobre atributos y propiedades .

Eventos

Nombre React Event Descripción Event Detail
gstock-after-hide-event onGstockAfterHideEvent Emitted after the tooltip closes and all animations are complete. -
gstock-after-show-event onGstockAfterShowEvent Emitted after the tooltip opens and all animations are complete. -
gstock-hide-event onGstockHideEvent Emitted when the tooltip closes. -
gstock-show-event onGstockShowEvent Emitted when the tooltip opens. -

Aprende más sobre eventos .

Slots

Nombre Descripción
default The tooltip’s target element. Avoid slotting in more than one element, as subsequent ones will be ignored.
content The content to render in the tooltip. Alternatively, you can use the content attribute.

Aprende más sobre slots .

Métodos

Nombre Descripción
show( ) Shows the tooltip
hide( ) Hides the tooltip

Aprende más sobre métodos .

Propiedades personalizadas

Nombre Descripción Default
--max-width The maximum width of the tooltip before its content will wrap.
--hide-delay The amount of time to wait before hiding the tooltip when hovering.
--show-delay The amount of time to wait before showing the tooltip when hovering.

Aprende más sobre propiedades personalizadas .

Partes

Nombre Descripción
base The component’s base wrapper, an <gstock-popup> element.
base__popup The popup’s exported popup part. Use this to target the tooltip’s popup container.
base__arrow The popup’s exported arrow part. Use this to target the tooltip’s arrow.
body The tooltip’s body where its content is rendered.

Aprende más sobre partes CSS .

Animaciones

Nombre Descripción
tooltip.show The animation to use when showing the tooltip.
tooltip.hide The animation to use when hiding the tooltip.

Aprende más sobre animaciones .

Dependencias

Este componente importa automáticamente las siguientes dependencias.