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
public class AnnotatedTextEditor : IComponent, IHasBackgroundColor, ITabIndexA multi-line text editor that supports inline annotations / highlights over user-entered prose.
Constructors
Properties
public string Text { get ; set ; }Gets or sets the text shown in the component.
public string Placeholder { get ; set ; }Gets or sets the placeholder text shown when the component is empty.
public string Background { get ; set ; }Gets or sets the CSS background of the component.
public int TabIndex { set ; }Sets the keyboard tab order of the component.
public bool IsEnabled { get ; set ; }Gets or sets a value indicating whether the component is interactive (enabled).
Methods
public AnnotatedTextEditor SetText(string text)Sets the text of the component.
public AnnotatedTextEditor SetPlaceholder(string placeholder)Sets the placeholder of the component.
public AnnotatedTextEditor Disabled(bool value = true)Disables the component.
public AnnotatedTextEditor ReadOnly(bool value = true)Configures the read only on the component.
public AnnotatedTextEditor OnTextChanged(TextChangedHandler handler)Registers a callback invoked when the text changed event fires.
public AnnotatedTextEditor OnAnnotationsChanged(AnnotationsChangedHandler handler)Registers a callback invoked when the annotations changed event fires.
public AnnotatedTextEditor OnEntityClick(EntityClickHandler handler)Registers a callback invoked when the entity click event fires.
public AnnotatedTextEditor Height(UnitSize unitSize)Gets or sets the CSS height of the component.
public AnnotatedTextEditor H(int px)Shortcut for setting the height in pixels.
public AnnotatedTextEditor MinHeight(UnitSize unitSize)Gets or sets the CSS min-height of the component.
public AnnotatedTextEditor Focus()Moves keyboard focus to the component.
public HTMLElement Render()Renders the component's root HTML element.
Events
public event AnnotationsChangedHandler AnnotationsChangedRaised when annotations changed occurs.
public event TextChangedHandler TextChangedRaised when text changed occurs.
Samples
Multi-line, editable, with entity highlighting
Read-only with clickable entities
Text cannot be edited, but entities still react to clicks.