inputshwcz-rte

Rich Text Editor

TipTap-based rich text editor with a configurable grouped toolbar, word counter, and HTML value submission.

Attributes

AttributeTypeDefaultDescription
toolbarstring''Custom toolbar as grouped JSON arrays, e.g. [["bold","italic"],["list"]]. Items: bold, italic, underline, strikethrough, list, list-ordered, h1–h6, align-left/center/right/justify, blockquote (aliases like strike and bullet-list are accepted).
readonlybooleanfalseMakes the editor non-editable while keeping the toolbar visible.
Inherited from InputMixin
AttributeTypeDefaultDescription
disabledbooleanfalseDisables the control so it cannot be interacted with.
formstring''Associates the hidden form input with a form by id, even when the component sits outside that form.
namestring''Field name for the hidden form input; array values submit as name[].
placeholderstring''Placeholder text for the control's empty state.
requiredbooleanfalseMarks the control as required.
valuestring''Initial value of the control, synchronized with the hidden form input.
Inherited from Hwc
AttributeTypeDefaultDescription
i18nstring''Per-instance text overrides as key: text pairs, merged over the global z-i18n script and the built-in defaults.
floatingstring''Floating UI placement options (for example offset and shiftPadding) parsed as key: value pairs.
force-prevent-rerenderbooleanfalseSkips re-rendering after the first render; an existing data-host-inner child is adopted as the rendered DOM.
templatestring''Selector or id of an external element or <template> whose inner content is cloned in place of an inline template[data-fn="template"] child.
Inherited from Base
AttributeTypeDefaultDescription
clsstring''Adds classes to named parts as key: classes pairs; a plain string targets the default part.
stlstring''Adds inline styles to named parts as key: styles pairs; a plain string targets the default part.

Custom Styling (cls / stl)

Default cls target:host-inner · defaultstl target:host-inner

KeyDefault classclsstlDescription
bodyz-rte-bodyyesyesEditor body wrapper (default z-rte-body).
buttonz-button z-button-default z-button-icon z-button-xsmallyesyesToolbar button (default z-button z-button-default z-button-icon z-button-xsmall).
editor—yesyesThe editable content region.
footerz-rte-footeryesyesFooter region with the word counter (default z-rte-footer).
headerz-rte-headeryesyesHeader region above the toolbar.
host-innerz-rteyesyesEditor root (default z-rte); the default cls/stl target.
toolbarz-rte-toolbaryesyesThe toolbar (default z-rte-toolbar).
toolbar-groupz-rte-toolbar-groupyesyesOne toolbar button group (default z-rte-toolbar-group).

i18n Keys

KeyDefaultPlaceholdersDescription
aria-editorRich text editor—Accessible label of the editable region.
aria-toolbarFormatting options—Accessible label of the toolbar. Used in: toolbar.
tooltip-align-centerAlign Center—Align center button tooltip.
tooltip-align-justifyAlign Justify—Align justify button tooltip.
tooltip-align-leftAlign Left—Align left button tooltip.
tooltip-align-rightAlign Right—Align right button tooltip.
tooltip-blockquoteBlockquote—Blockquote button tooltip.
tooltip-boldBold—Bold button tooltip.
tooltip-h1Heading 1—Heading 1 button tooltip.
tooltip-h2Heading 2—Heading 2 button tooltip.
tooltip-h3Heading 3—Heading 3 button tooltip.
tooltip-h4Heading 4—Heading 4 button tooltip.
tooltip-h5Heading 5—Heading 5 button tooltip.
tooltip-h6Heading 6—Heading 6 button tooltip.
tooltip-italicItalic—Italic button tooltip.
tooltip-listList—Bullet list button tooltip.
tooltip-list-orderedOrdered List—Ordered list button tooltip.
tooltip-strikethroughStrikethrough—Strikethrough button tooltip.
tooltip-underlineUnderline—Underline button tooltip.
word-counter-pluralwords—Word counter plural unit.
word-counter-singularword—Word counter singular unit.

Events

EventDetailFlagsDescription
z-rte:input · from InputMixin{ value: string | string[] }bubblesFires when the content changes; detail.value carries the HTML string.

Data Hooks

AttributeValuesApplies toRoleDescription
data-disabled—descendantmarkerSet while the control is disabled.
data-host-inner · from Hwc—descendantconfigMarks the rendered inner wrapper so force-prevent-rerender can adopt server-rendered DOM without re-rendering.
data-partbodydescendantmarkerMarks the editor body in adopted server-rendered DOM (data-part="body").
data-reactive · from Hwc—descendantconfigOpts the marked child (config script, data source, icons, or template) into live re-parsing when its DOM mutates.
data-readonly—descendantmarkerSet while the editor is read-only.
data-tooltip—descendantmarkerTooltip text on toolbar buttons (consumed by the tooltip singleton).

Child Content

script[data-fn="config"][type="application/json"]

JSON configuration script parsed by the base class (i18n, cls, stl, floating).

AttributeRequiredTypeDescription
data-fnyesconfigMarks the script as configuration (value: config).
data-reactivenobooleanRe-parses the configuration when the script mutates.

select[data-fn="data-source"]

Hidden select parsed into grouped option data by the base class.

AttributeRequiredTypeDescription
data-fnyesdata-sourceMarks the select as the data source (value: data-source).
data-reactivenobooleanRe-parses the options when the select mutates.

optgroup · repeatable

Groups options under a label.

AttributeRequiredTypeDescription
labelyesstringGroup header text; also the default group key.
disablednobooleanDisables every option in the group.
data-keynostringOverrides the group key used in the parsed data.
data-keywordsnocomma-separated stringComma-separated keywords stored with the group's data.

option · repeatable

One option entry within the group.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated; searched alongside the label and value.

option · repeatable

One ungrouped option entry.

AttributeRequiredTypeDescription
valuenostringValue carried by this option in the parsed data.
disablednobooleanMakes the option non-selectable.
selectednobooleanMarks the option as initially selected.
data-keywordsnocomma-separated stringExtra search terms, comma-separated.

template[data-fn="icons"]

Instance-level icon repository.

AttributeRequiredTypeDescription
data-fnyesiconsMarks the template as an icon source (value: icons).
data-reactivenobooleanRe-parses the icons when the template mutates.

* · repeatable

One icon element.

AttributeRequiredTypeDescription
data-keyyesstringIcon key referenced by $icons.

template[data-fn="template"]

Deferred content template mounted by the base class.

AttributeRequiredTypeDescription
data-fnyestemplateMarks the template for deferred mounting (value: template).
data-reactivenobooleanRe-parses the template when it mutates.

template[data-fn="value"]

Initial HTML content template (<template data-fn="value">).

AttributeRequiredTypeDescription
data-fnyesvalueMarks the template as the initial value (value: value).
data-reactivenobooleanRe-reads the initial content when the template mutates.

Keyboard

KeysActionWhen
Mod+B Mod+I Mod+UTipTap shortcuts for bold/italic/underline inside the editor.—

Accessibility

PartARIADescription
body—Editor body; no static ARIA attributes.
buttonaria-label="${label}" aria-pressed="${isActive ? 'true' : 'false'}"Toolbar button labeled by its tooltip text, aria-pressed reflects the active mark/node.
footeraria-atomic="true" aria-live="polite"Word counter: aria-live with aria-atomic for polite updates.
header—Header region; no ARIA attributes.
host-inner—Editor root; no static ARIA attributes.
toolbararia-label="${this.getI18nText('aria-toolbar', this.defaultI18n)}" role="toolbar"Toolbar: role="toolbar" labeled by aria-toolbar.
toolbar-grouprole="group"Button group: role="group".
  • Toolbar buttons expose their state with aria-pressed; the word counter updates politely.
  • The HTML value submits through the hidden form input.