Skip to content

feat(component): Annotation / Highlight #18

@bntvllnt

Description

@bntvllnt

Summary

Text annotation and highlighting component for educational content. Allows inline highlights with tooltips, margin notes, and collaborative annotations. Unique to the educational suite.

Motivation

Educational content needs inline annotations — highlight key terms, add instructor notes, show student highlights. This bridges the gap between static content and interactive learning.

Proposed API

{/* Inline highlight with tooltip */}
<Annotate type="definition" note="A function that calls itself">
  recursive function
</Annotate>

{/* Margin note */}
<Annotate type="margin" note="This concept is crucial for the exam">
  <p>Binary search divides the search space in half...</p>
</Annotate>

{/* Highlight with category */}
<Annotate type="highlight" color="yellow" category="key-concept">
  O(log n) time complexity
</Annotate>

Requirements

  • Inline text highlighting with color variants
  • Hover/click tooltip with annotation content
  • Margin notes (rendered in document margin)
  • Highlight categories (key-concept, warning, definition, example)
  • Color coding per category
  • Accessible: ARIA annotations, screen reader support
  • Works within MDX content
  • Multiple annotations can overlap
  • CVA variants for highlight styles

Educational Use Cases

  • Instructor annotations on reading material
  • Key term highlighting with definitions
  • Student note-taking on content
  • Code annotation (highlight specific lines with explanations)

Technical Notes

  • Renders as <mark> with tooltip wrapper
  • Integrates with existing Tooltip component
  • MDX-compatible (usable via mdxComponents)

Metadata

Metadata

Assignees

No one assigned

    Labels

    componentNew componenteducationalEducational suite componentsp1-highHigh priority — strengthens moat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions