ViText options

Constructor parameters, defaults and configuration validation.

1.0.0-beta.6 · Local build · desktop

Document and callbacks

new ViText(target, options?) accepts a selector or HTMLElement.

OptionType/defaultContract
contentstring/DocumentNode; empty documentInitial HTML/JSON/Markdown
contentTypehtml/markdown/json; html for stringObjects identify structured JSON
cssstring; emptySeparate initial stylesheet, asynchronous
labelstring; DocumentAccessible document name
onChangeChangeEvent callbackApplied document change
markdownPasteboolean; enabled with Markdown supportConvert pasted plain Markdown text
languageru/en; ruEditor UI language
markdownDraftstring; emptyInitial Markdown draft, checked when opened

Interface and resources

OptionType/defaultContract
presetsimple/base/pro; proUpper limit of available UI features
toolbarreadonly ToolbarItem; preset defaultSubset with automatic library groups
toolbarLayoutreadonly ToolbarLayoutItem; absentExplicit order, separators, spacer and menus
featuresPartial<EditorFeatures>; preset defaultshtml/markdown/css/fullscreen/tables/images/plugins
pluginsreadonly ViTextPlugin; emptyAPI 1 extensions, when enabled
uploadImageFile + AbortSignal callback; absentApplication-owned upload, otherwise URL insertion
onToolbarOverflowToolbarItem callback; absentTools moved to overflow
sourceModuleURLstring; alongside buildTrusted HTML/CSS UI module
codecsModuleURLstring; alongside buildTrusted Markdown/CSS engines

Unsupported features, duplicate tools, nested menus or more than one spacer throw TypeError. CSS requires HTML. Failed plugin installation releases already installed resources. HTML/JSON without CSS apply immediately; await whenReady for initial Markdown/CSS and whenSourceReady for source controls. Presets, methods.

Search documentation

No results. Try different words.

All documentation