The <Tooltip> component displays additional information when users hover over text or code elements. Use tooltips to provide context, definitions, or explanations without cluttering your documentation.
Documentation becomes more interactive when you add tooltips to key terms.
You can include rich content with custom positioning for more detailed explanations
The code tooltip component allows you to provide contextual information for variables and values within your code examples. When users hover over highlighted code, they can see explanations, documentation links, or additional context without leaving the code example.
The content to display in the tooltip. Can be a simple string or React component for more complex content.
Controls which side of the element the tooltip appears on.
The distance between the tooltip and the trigger element (px).
Key-value pairs where the values are displayed in your code blocks.
Key-value pairs where the values are displayed in the tooltips. The Key for tooltips must match the Key for data.
To customize code tooltips, target the .fern-mdx-tooltip-content selector. You can override CSS variables or add any custom styles:
To customize text tooltips, target the .fern-mdx-tooltip-trigger selector. You can override CSS variables for common customizations or add any custom styles: