Ir al contenido

co-rich-text-editor

Ver código
<co-rich-text-editor preset="task" label="Ejemplo" placeholder="Escribe aquí…"></co-rich-text-editor>

Props

PropAtributoTipoDefaultDescripción
accountFontsaccount-fontsstring | undefined | { label: string; value: string; }[]Account/imported fonts shown in a separate "Imported fonts" section. JS property: `Array<{ label: string; value: string }>`. HTML attribute: JSON string of the same array.
autofocusautofocusbooleanfalse
customExtensionsobject[] | undefinedExtra Tiptap extensions appended to the preset (JS property only). Registered at editor creation — required for new schema nodes (images, tables, embeds, …) that `getEditorInstance()` cannot add afterwards.
disableddisabledbooleanfalse
featuresfeaturesobject | string | undefinedFeature overrides (JSON string for HTML attr, or object via JS property).
fontFamiliesfont-familiesstring | undefined | { label: string; value: string; }[]Font families available in the bubble menu font selector. JS property: `Array<{ label: string; value: string }>`. HTML attribute: JSON string of the same array. If not provided, a default list of system fonts is used.
fontLoader(() => Promise<{ label: string; value: string; url?: string | undefined; }[]>) | undefinedAsync callback that loads account/imported fonts. Called once when the font dropdown opens for the first time. Must return `Array<{ label: string; value: string; url?: string }>`. If `url` is provided, the font is registered via FontFace API. JS property only — cannot be set via HTML attribute.
fontsLoadingfonts-loadingboolean | undefinedWhether account fonts are currently loading.
helperTexthelper-textstring | undefined
imageUpload((file: File) => Promise<string>) | undefinedHost image upload handler (JS property): `(file) => Promise<url>`.
labellabelstring | undefined
localelocalestring'en'BCP-47 locale for UI strings (e.g. 'en', 'es-CO', 'pt-BR'). Default English.
maxLengthmax-lengthnumber | undefined
placeholderplaceholderstring''
presetpreset"comment" | "document" | "email" | "task"'task'Preset controlling allowed nodes/marks, toolbar and sanitization.
readonlyreadonlybooleanfalse
requiredrequiredbooleanfalse
secondaryLabelsecondary-labelstring | undefined
showCharacterCountshow-character-countbooleanfalse
statusstatus"default" | "error" | "info" | "success" | "warning"'default'
toolbartoolbar"auto" | "basic" | "compact" | "full" | "none"'auto'Toolbar layout. `auto` uses the preset default.
valuevaluenull | stringnullProseMirror document as a JSON string. `null`/empty = empty editor.

Eventos

EventoDetailBubblesCancelableDescripción
coBlurvoid
coChangeRichTextOutputEmitted on blur (committed value).
coClearvoid
coFocusvoid
coFontPopupHidevoidEmitted when the font dropdown closes.
coFontPopupShowvoidEmitted when the font dropdown opens — host should load account fonts.
coInputRichTextOutputEmitted on every keystroke.
coReadyvoidEmitted once the editor is mounted and ready.

Slots

Este componente no expone slots.

CSS Parts

PartDescripción
::part(content)Editable ProseMirror surface
::part(helper)Helper text row
::part(label)Field label
::part(toolbar)Formatting toolbar
::part(wrapper)Outer container

CSS Custom Properties

Este componente no expone CSS custom properties.