Tooltip
certara-tooltip
Section titled “certara-tooltip”A tooltip component that displays contextual information when users hover over or focus on an element. The tooltip automatically positions itself to avoid viewport boundaries and can be configured with various placement options.
Properties
Section titled “Properties”content
| Attribute | content |
| Type | string |
| Default | undefined |
| Required | false |
| Description | Text content for the tooltip. This prop can be used as an alternative to or in combination with the tooltip-content slot. |
placement
| Attribute | placement |
| Type | "bottom" | "bottom-start" | "left" | "left-start" | "right" | "right-start" | "top" | "top-start" |
| Default | undefined |
| Required | false |
| Description | Position defaults to undefined which automatically picks an unobstructed direction |
position
| Attribute | position |
| Type | "absolute" | "fixed" |
| Default | 'absolute' |
| Required | false |
| Description | Use ‘fixed’ to break a tooltip out of a positioned container |
Events
Section titled “Events”There are no events available for this component
Methods
Section titled “Methods”There are no public methods available for this component
| Name | Description |
|---|---|
| Content in the default slot is the opener for the tooltip. This is the element that triggers the tooltip display. | |
tooltip-content | Optional slot if rich content is needed for the tooltip content for the tooltip. |
CSS Custom Properties
Section titled “CSS Custom Properties”| Name | Description |
|---|---|
--wc-tooltip-arrow-size | The component needs this to set the offset of the tooltip arrow |
A tooltip is a short descriptive messages that provides additional information about a UI element or feature. It is triggered when the element it relates to is hovered over or otherwise focused.
Design guidelines
Section titled “Design guidelines” Best practices
Section titled “Best practices”Use tooltips for very short text that adds context to UI elements. Use sparingly.
- Displaying a tooltip requires a user to hover over (or focus on) the related element.
- Dismissing a tooltip requires a user to shift focus away from the element.
- Be mindful of placement - a tooltip should not obscure critical elements on the page.
Accessibility
Section titled “Accessibility”- Tooltips should be operable using the keyboard alone.
- Tooltips should be announced by screen readers.
For more information, see our accessibility guidelines.