Waveform
Video waveform monitor rendered on canvas
Size
Material
<div class="waveform-wrap">
<canvas class="waveform-canvas" width="200" height="80" id="waveCanvas"></canvas>
</div> .waveform-wrap {
background: #0a0a0a; border: 1px solid #1e1e1e;
border-radius: var(--radius-sm); padding: 2px;
box-shadow: inset 0 1px 4px rgba(0,0,0,0.6);
}
.waveform-canvas { display: block; border-radius: 2px; } API
| Class | Type | Description |
|---|---|---|
.waveform-wrap | Base | Primary component class |
.md | Size | Medium (default) variant |
Design Notes
Physical Analog
Reference devices: Final Cut Pro waveform monitor, DaVinci Resolve parade scope, broadcast waveform monitors. Mechanism: Shows brightness value for each horizontal position in image. Y-axis = luma level (0-100 IRE). Used in broadcast to ensure legal signal levels.
Geometry
| Property | Value |
|---|---|
| Canvas | 200x80px |
| Container padding | 2px |
| Border-radius | var(--radius-sm) |
CSS Recipe
Container
.waveform-wrap {
background: #0a0a0a; border: 1px solid #1e1e1e;
border-radius: var(--radius-sm); padding: 2px;
box-shadow: inset 0 1px 4px rgba(0,0,0,0.6);
}
Canvas
.waveform-canvas { display: block; border-radius: 2px; }
HTML Structure
<div class="waveform-wrap">
<canvas class="waveform-canvas" width="200" height="80" id="waveCanvas"></canvas>
</div>
Size Variants
No explicit size variants.
Material Variants
Single material: Phosphor screen.
Theme Behavior
- Container uses hardcoded dark colors
- Canvas content rendered by JS
Constraints
- Canvas renders 200x80px audio waveform.
- Single stroke path using compound sine waves (
sin(x*0.08)+sin(x*0.03)) with random jitter. - Stroke color:
rgba(102,255,102,0.6), 1px line width. - Container MUST match histogram container styling.
- Requires JS for canvas rendering.
Accessibility
- Use
role="img"on canvas witharia-label - Provide text fallback for screen readers
♿
Accessibility
- Element
- Use semantic HTML with appropriate ARIA roles
- Keyboard
- Follow WAI-ARIA patterns for this control type
- Focus
-
Visible focus indicator required. Use native browser focus ring or custom
:focus-visiblestyles.