Overview
Annotation control components provide UI for managing annotation editing features. These components integrate with bothWaveformPlaylistProvider and MediaElementPlaylistProvider contexts.
Package: @waveform-playlist/browser (context-connected) and @waveform-playlist/annotations (base components)
Requires:
- Provider context (
WaveformPlaylistProviderorMediaElementPlaylistProvider) AnnotationProviderfrom@waveform-playlist/annotations
ContinuousPlayCheckbox
Checkbox control for enabling/disabling continuous play of annotations.Behavior
- When enabled: Playback continues from one annotation to the next without stopping
- When disabled: Playback stops at the end of each annotation
Context-Connected Component
Package:@waveform-playlist/browser
Props
Additional CSS class name for styling.
Usage
Base Component
Package:@waveform-playlist/annotations
Props
Whether continuous play is enabled.
Callback when the checkbox state changes.
Whether the checkbox is disabled.
Additional CSS class name.
Usage
LinkEndpointsCheckbox
Checkbox control for enabling/disabling linked endpoints between annotations.Behavior
- When enabled: The end time of one annotation is automatically linked to the start time of the next annotation. Dragging one boundary moves the adjacent annotation’s boundary.
- When disabled: Annotations can be edited independently with gaps or overlaps.
Context-Connected Component
Package:@waveform-playlist/browser
Props
Additional CSS class name for styling.
Usage
Base Component
Package:@waveform-playlist/annotations
Props
Whether endpoints are linked.
Callback when the checkbox state changes.
Whether the checkbox is disabled.
Additional CSS class name.
EditableCheckbox
Checkbox control for enabling/disabling annotation editing.Behavior
- When enabled: Annotation boundaries can be dragged, text can be edited, and action controls are shown
- When disabled: Annotations are read-only and can only be played
Context-Connected Component
Package:@waveform-playlist/browser
Props
Additional CSS class name for styling.
Usage
Base Component
Package:@waveform-playlist/annotations
Props
Whether annotations are editable.
Callback when the checkbox state changes.
Additional CSS class name.
DownloadAnnotationsButton
Button component for downloading annotations as JSON file.Behavior
- Serializes annotations to Aeneas JSON format
- Triggers browser download with customizable filename
- Disabled when there are no annotations
- Shows contextual title/tooltip text
Context-Connected Component
Package:@waveform-playlist/browser
Props
Name of the downloaded file.
Additional CSS class name for styling.
Usage
Base Component
Package:@waveform-playlist/annotations
Props
Array of annotations to download.
Name of the downloaded file.
Whether the button is disabled.
Additional CSS class name.
Button text/content.
PlaylistAnnotationList
Standalone annotation text list component for displaying and editing annotation text. Package:@waveform-playlist/browser
Requires:
WaveformPlaylistProvidercontextAnnotationProviderfrom@waveform-playlist/annotations
Props
Height in pixels for the annotation text list.
Custom render function for annotation items in the text list. When provided, completely replaces the default annotation item rendering.
Callback when annotations are updated (e.g., text edited). Called with the full updated annotations array.
Action controls to show on each annotation item (e.g., delete, split). Only rendered when annotations are editable.
Override annotation list config. Falls back to context values
{ linkEndpoints, continuousPlay } if not provided.Where to position the active annotation when auto-scrolling.
Which scrollable containers to scroll: ‘nearest’ (only the annotation list) or ‘all’ (including viewport).
Usage
Complete Annotation Controls Example
Important Notes
The context-connected components (from
@waveform-playlist/browser) throw an error if used without <AnnotationProvider>. This follows the Kent C. Dodds context pattern to fail fast with clear error messages.