Skip to content

Hover Note Component Example

This guide demonstrates how to use the HoverNote component to add interactive hover notes to your documentation.

A hover note is a highlighted text element that displays additional information when the user hovers their mouse over it. This is useful for providing supplementary context without cluttering the main content.

For simple text without complex formatting, you can use the content prop.

Hover over this text

For rich content including math, code blocks, or lists, use the note slot. This leverages Starlight’s full rendering engine.

Hover for a mathematical formula

You can include almost anything inside a hover note:

Hover for code and lists

  1. Keep content concise: Hover notes should provide quick additional context.
  2. Use clear labels: Make it obvious what type of information is in the note.
  3. Don’t overuse: Only add hover notes where they provide real value.
  4. Consider mobile users: Hover notes may require a tap on touch devices.