DOCS
v0.4

AI Components / Annotation

Annotation

NER-style text annotation with inline underline highlighting, label filters, and editable mode.

ai-workflowv0.3.0

Playground

Examples

NER entities
<ai-annotation style="max-width:560px;"></ai-annotation>
Editable
<ai-annotation editable style="max-width:560px;"></ai-annotation>

Import

import { AiAnnotation } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/ai-annotation';

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

API Reference

PropTypeDefaultDescription
contentstringPlain text to annotate
annotations{start, end, label, confidence?}[]Entity annotations
labels{name, color}[]Label types with colors
editablebooleanfalseAllow creating annotations

Events

EventDetailDescription
ai-annotation-add{annotation, text}Annotation created
ai-annotation-select{annotation}Annotation clicked