DOCS
v0.4

AI Components / Segmentation Viewer

Segmentation Viewer

Image segmentation viewer with colored mask overlays, legend, visibility toggles, and opacity control.

ai-vizv0.6.0

Playground

Examples

Segmentation
<ai-segmentation-viewer src="https://picsum.photos/seed/segment/500/300" showLegend showLabels opacity="0.4" style="max-width:500px;"></ai-segmentation-viewer>

Import

import { AiSegmentationViewer } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/ai-segmentation-viewer';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
srcstringImage URL
masks{id, label, color, visible?}[]Segment masks
selectedMaskstringSelected mask ID
opacitynumber0.4Mask opacity 0-1
showLabelsbooleanfalseShow mask labels
showLegendbooleanfalseShow legend panel

Events

EventDetailDescription
ai-segment-select{id, label}Mask selected
ai-segment-toggle{id, visible}Mask visibility toggled