Embedding Annotations in Your UI
Annotations map compliance issues to specific locations in content. This guide shows how to use them to highlight issues natively in your application.Annotation Types
Text Span
For scripts, ad copy, captions, descriptions.startandendare character offsets (0-indexed) into the originalcontent.text- Highlight
matchedTextin the editor with the appropriate severity color - Show
messageon hover/click - Show
suggestionas an inline fix option
Timeline
For video content with timestamps.- Mark the flagged time range on the video timeline
trackindicates which track (video, audio, subtitle)- Show a warning marker at
startMson the timeline scrubber
Image Region
For visual content with detected elements.- Draw a highlight rectangle at the bounding box coordinates
boundingBoxuses pixel coordinates relative to the original image dimensions
Global
Applies to the entire content, not a specific location.- Show as a banner or top-level warning
- Not tied to a specific content location
Severity Colors (Suggested)
| Severity | Color | Usage |
|---|---|---|
| critical | Red (#FF3B30) | Bright red highlight, blocking banner |
| high | Orange (#FF9500) | Orange highlight, prominent warning |
| medium | Yellow (#FFCC00) | Yellow highlight, informational |
| low | Blue (#007AFF) | Subtle blue indicator |
| info | Gray (#8E8E93) | Gray text, no highlight |
Grouping Annotations
For a clean UI, group annotations by:- By agent — “Advertising Law: 2 issues, Platform Policy: 1 issue”
- By severity — Show critical/high first
- By location — Sort text-span by
startoffset, timeline bystartMs