Tooltip
Contextual information on hover
Tooltips display additional context or definitions when users hover over text.
Basic Tooltip
Hover over API to see the definition.A set of protocols for software applications to communicate.
<Tooltip tip="A set of protocols for software applications to communicate.">
API
</Tooltip>
With Headline
Add a headline above the tip text:
Hover over API to see the definition with a headline.APIApplication Programming Interface: a set of protocols for software applications to communicate.
<Tooltip
headline="API"
tip="Application Programming Interface: a set of protocols for software applications to communicate."
>
API
</Tooltip>
With Call-to-Action Link
Include a link for users to learn more:
Learn about APIs in our documentation.APIApplication Programming Interface: a set of protocols for software applications to communicate.Learn more →
<Tooltip
headline="API"
tip="Application Programming Interface: a set of protocols..."
cta="Read our API guide"
href="/api-reference"
>
API
</Tooltip>
Inline Usage
Tooltips work inline with text. You can explain HTML, CSSHyperText Markup Language, or JSCascading Style Sheets terms inline.JavaScript
Explain <Tooltip tip="HyperText Markup Language">HTML</Tooltip>,
<Tooltip tip="Cascading Style Sheets">CSS</Tooltip>, or
<Tooltip tip="JavaScript">JS</Tooltip> terms inline.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
tip | string | Required | The tooltip text displayed on hover |
headline | string | - | Text displayed above the tip |
cta | string | - | Call-to-action link text |
href | string | - | URL for the call-to-action (required with cta) |
children | ReactNode | - | The text that triggers the tooltip |
Accessibility
- Tooltips are keyboard accessible (Tab to focus, shows on focus)
- Uses
role="tooltip"for screen readers - Trigger text has a dashed underline to indicate interactivity