Skip to content

Tooltip

Design guidelines
HTML
React
Angular
Hover me
<certara-tooltip content="Default tooltip">
<certara-button>Hover me</certara-button>
</certara-tooltip>
import { CertaraButton, CertaraTooltip } from '@certara/certara-ui-react';
<CertaraTooltip content="Default tooltip">
<CertaraButton>Hover me</CertaraButton>
</CertaraTooltip>
// In your module (e.g., app.module.ts)
import { CertaraUiAngularModule } from '@certara/certara-ui-angular';
@NgModule({
imports: [CertaraUiAngularModule]
})
// In your template:
<certara-tooltip content="Default tooltip">
<certara-button>Hover me</certara-button>
</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.

content

Attributecontent
Typestring
Defaultundefined
Requiredfalse
DescriptionText content for the tooltip. This prop can be used as an alternative to or in combination with the tooltip-content slot.

placement

Attributeplacement
Type"bottom" | "bottom-start" | "left" | "left-start" | "right" | "right-start" | "top" | "top-start"
Defaultundefined
Requiredfalse
DescriptionPosition defaults to undefined which automatically picks an unobstructed direction

position

Attributeposition
Type"absolute" | "fixed"
Default'absolute'
Requiredfalse
DescriptionUse ‘fixed’ to break a tooltip out of a positioned container

There are no events available for this component

There are no public methods available for this component

NameDescription
Content in the default slot is the opener for the tooltip. This is the element that triggers the tooltip display.
tooltip-contentOptional slot if rich content is needed for the tooltip content for the tooltip.
NameDescription
--wc-tooltip-arrow-sizeThe 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.

Hover over a button to view the tooltip.
On the leftTooltip leftOn the topTooltip topOn the bottomTooltip bottomOn the rightTooltip right

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.
  • Tooltips should be operable using the keyboard alone.
  • Tooltips should be announced by screen readers.

For more information, see our accessibility guidelines.

View component in Figma