Skip to main content

Skeletons.RichText

A rich text editor or viewer — supports both editable and read-only modes, inline formatting, auto-linking, and tag support. Use it for notes, documents, and any content that requires formatted text input.


Signature​

// Full object form
Skeletons.RichText(props, style?)

// Shorthand — string content
Skeletons.RichText("My text")

// Shorthand — string content + class name
Skeletons.RichText("My text", "my-class")

Common Props​

PropTypeDescription
contentStringInitial text content. Defaults to "" if omitted
classNameStringCSS class(es) to apply
sys_pnStringNamed part — enables onPartReady and ensurePart
nameStringModel key this editor is bound to
roleStringEditor role — e.g. "editor" for write mode
modeStringInteraction mode — e.g. "interactive"
readwriteNumber1 to enable editing
autofocusNumber / BooleanFocus the editor on render
placeholderStringPlaceholder text shown when empty
serviceStringService triggered on submit or raise
tagsAnyTag configuration for tagging support
uiHandlerWidgetRoutes interaction events to onUiEvent

Examples​

Editable note with tags​

Skeletons.RichText({
className: `${fig}__editor`,
sys_pn: "text-content",
name: "content",
role: "editor",
readwrite: 1,
autofocus: 1,
placeholder: LOCALE.MY_PLACEHOLDER,
service: "raise",
tags,
});

Note: automatic URL linkification (autolink) is not currently implemented — the Autolinker integration is commented out in widgets/text/editable. Passing autolink has no effect; it has been removed from the prop list above until the feature is restored.

Interactive viewer with initial content​

Skeletons.RichText({
className: `${fig}__content`,
sys_pn: "content",
name: "content",
content: ui.mget("content"),
mode: "interactive",
autofocus: ui.mget("autofocus"),
placeholder: ui.getPlaceholder(),
service: "submit",
});