AI Components / Annotation
Annotation
NER-style text annotation with inline underline highlighting, label filters, and editable mode.
ai-workflow v0.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
| Prop | Type | Default | Description |
|---|---|---|---|
content | string | — | Plain text to annotate |
annotations | {start, end, label, confidence?}[] | — | Entity annotations |
labels | {name, color}[] | — | Label types with colors |
editable | boolean | false | Allow creating annotations |
Events
| Event | Detail | Description |
|---|---|---|
ai-annotation-add | {annotation, text} | Annotation created |
ai-annotation-select | {annotation} | Annotation clicked |