Tesserae

AnnotatedTextEditor

Description

Annotated text editor

AnnotatedTextEditor is a multi-line editable text field that highlights NLP entities in place, like the OmniBox token rendering. A debounced async lambda (default 500ms) is called after the user stops typing and returns the entities found in the text.

Try editing the text below — entities are re-detected after you pause typing.

API reference

class

AnnotatedTextEditor

public class AnnotatedTextEditor : IComponent, IHasBackgroundColor, ITabIndex

A multi-line text editor that supports inline annotations / highlights over user-entered prose.

Constructors

Constructor
AnnotatedTextEditor
public AnnotatedTextEditor(Func<string, Task<Entity[]>> annotator, string initialText = null, int debounceMs = 500, string placeholder = null)

Initializes a new instance of this class.

Properties

Property
AnnotatedTextEditor.Text
public string Text { get ; set ; }

Gets or sets the text shown in the component.

Property
AnnotatedTextEditor.Entities
public Entity[] Entities

Gets or sets the entities.

Property
AnnotatedTextEditor.Placeholder
public string Placeholder { get ; set ; }

Gets or sets the placeholder text shown when the component is empty.

Property
AnnotatedTextEditor.Background
public string Background { get ; set ; }

Gets or sets the CSS background of the component.

Property
AnnotatedTextEditor.TabIndex
public int TabIndex { set ; }

Sets the keyboard tab order of the component.

Property
AnnotatedTextEditor.IsEnabled
public bool IsEnabled { get ; set ; }

Gets or sets a value indicating whether the component is interactive (enabled).

Property
AnnotatedTextEditor.IsReadOnly
public bool IsReadOnly { get ; set ; }

Returns a value indicating whether the component is read only.

Methods

Method
AnnotatedTextEditor.SetText
public AnnotatedTextEditor SetText(string text)

Sets the text of the component.

Method
AnnotatedTextEditor.SetPlaceholder
public AnnotatedTextEditor SetPlaceholder(string placeholder)

Sets the placeholder of the component.

Method
AnnotatedTextEditor.Disabled
public AnnotatedTextEditor Disabled(bool value = true)

Disables the component.

Method
AnnotatedTextEditor.ReadOnly
public AnnotatedTextEditor ReadOnly(bool value = true)

Configures the read only on the component.

Method
AnnotatedTextEditor.OnTextChanged
public AnnotatedTextEditor OnTextChanged(TextChangedHandler handler)

Registers a callback invoked when the text changed event fires.

Method
AnnotatedTextEditor.OnAnnotationsChanged
public AnnotatedTextEditor OnAnnotationsChanged(AnnotationsChangedHandler handler)

Registers a callback invoked when the annotations changed event fires.

Method
AnnotatedTextEditor.OnEntityClick
public AnnotatedTextEditor OnEntityClick(EntityClickHandler handler)

Registers a callback invoked when the entity click event fires.

Method
AnnotatedTextEditor.Height
public AnnotatedTextEditor Height(UnitSize unitSize)

Gets or sets the CSS height of the component.

Method
AnnotatedTextEditor.H
public AnnotatedTextEditor H(int px)

Shortcut for setting the height in pixels.

Method
AnnotatedTextEditor.MinHeight
public AnnotatedTextEditor MinHeight(UnitSize unitSize)

Gets or sets the CSS min-height of the component.

Method
AnnotatedTextEditor.Focus
public AnnotatedTextEditor Focus()

Moves keyboard focus to the component.

Method
AnnotatedTextEditor.Render
public HTMLElement Render()

Renders the component's root HTML element.

Method
AnnotatedTextEditor.TriggerAnnotate
public void TriggerAnnotate()

Configures the trigger annotate on the component.

Events

Event
AnnotatedTextEditor.AnnotationsChanged
public event AnnotationsChangedHandler AnnotationsChanged

Raised when annotations changed occurs.

Event
AnnotatedTextEditor.TextChanged
public event TextChangedHandler TextChanged

Raised when text changed occurs.

Event
AnnotatedTextEditor.EntityClicked
public event EntityClickHandler EntityClicked

Raised when entity clicked occurs.

Samples

Multi-line, editable, with entity highlighting

Read-only with clickable entities

Text cannot be edited, but entities still react to clicks.

See also

Referenced by

© 2026 Tesserae. All rights reserved.