JavaScript/jQuery HtmlEditor Types
AIChangeStyleCommand
Specifies a "change style" command for the "ai" toolbar item.
To allow users to use this command, add its name to the commands array:
jQuery
$('.html-editor').dxHtmlEditor({ aiIntegration, toolbar: { items: [ { name: 'ai', commands: [ 'changeStyle', 'changeTone', ], }, ], } });
Angular
<dx-html-editor [aiIntegration]="aiIntegration" > <dxo-html-editor-toolbar> <dxi-html-editor-toolbar-item name="ai"> <dxi-html-editor-command name="changeStyle"></dxi-html-editor-command> <dxi-html-editor-command name="changeTone"></dxi-html-editor-command> </dxi-html-editor-toolbar-item> </dxo-html-editor-toolbar> </dx-html-editor>
Vue
<template> <DxHtmlEditor :ai-integration="aiIntegration" > <DxToolbar> <DxItem name="ai"> <DxCommand name="changeStyle" /> <DxCommand name="changeTone" /> </DxItem> </DxToolbar> </DxHtmlEditor> </template> <script setup lang="ts"> import { DxHtmlEditor, DxToolbar, DxItem, DxCommand } from 'devextreme-vue/html-editor'; // ... </script>
React
import React from 'react'; import HtmlEditor, { Toolbar, Item, Command } from 'devextreme-react/html-editor'; export default function App() { return ( <HtmlEditor aiIntegration={aiIntegration} > <Toolbar> <Item name="ai"> <Command name="changeStyle" /> <Command name="changeTone" /> </Item> </Toolbar> </HtmlEditor> ); }
AIChangeStyleOption
Includes all predefined options for the "change style" command.
AIChangeToneCommand
Specifies a "change tone" command for the "ai" toolbar item.
To allow users to use this command, add its name to the commands array:
jQuery
$('.html-editor').dxHtmlEditor({ aiIntegration, toolbar: { items: [ { name: 'ai', commands: [ 'changeStyle', 'changeTone', ], }, ], } });
Angular
<dx-html-editor [aiIntegration]="aiIntegration" > <dxo-html-editor-toolbar> <dxi-html-editor-toolbar-item name="ai"> <dxi-html-editor-command name="changeStyle"></dxi-html-editor-command> <dxi-html-editor-command name="changeTone"></dxi-html-editor-command> </dxi-html-editor-toolbar-item> </dxo-html-editor-toolbar> </dx-html-editor>
Vue
<template> <DxHtmlEditor :ai-integration="aiIntegration" > <DxToolbar> <DxItem name="ai"> <DxCommand name="changeStyle" /> <DxCommand name="changeTone" /> </DxItem> </DxToolbar> </DxHtmlEditor> </template> <script setup lang="ts"> import { DxHtmlEditor, DxToolbar, DxItem, DxCommand } from 'devextreme-vue/html-editor'; // ... </script>
React
import React from 'react'; import HtmlEditor, { Toolbar, Item, Command } from 'devextreme-react/html-editor'; export default function App() { return ( <HtmlEditor aiIntegration={aiIntegration} > <Toolbar> <Item name="ai"> <Command name="changeStyle" /> <Command name="changeTone" /> </Item> </Toolbar> </HtmlEditor> ); }
AIChangeToneOption
Includes all predefined options for the "change tone" command.
AICommand
The union of all command types.
AICommandBase
Specifies basic options for the "ai" toolbar item commands.
AICommandName
All predefined command names.
AICommandNameExtended
An extended type for command names. Includes predefined and custom command names.
AICustomCommand
Specifies a custom command for the "ai" toolbar item.
To define a custom command, do the following:
- Set
name
to "custom". - Define
text
for the title in the command list. - Create a prompt.
jQuery
$('.html-editor').dxHtmlEditor({ aiIntegration, toolbar: { items: [ { name: 'ai', commands: [ { name: 'custom', text: 'Target Audience', prompt: () => { return 'Based on the text, who is the most likely target audience? Give a short explanation'; }, } ], }, ], } });
Angular
<dx-html-editor [aiIntegration]="aiIntegration" > <dxo-html-editor-toolbar> <dxi-html-editor-toolbar-item name="ai"> <dxi-html-editor-command name="custom" text="Target Audience" [prompt]="targetAudiencePrompt" ></dxi-html-editor-command> </dxi-html-editor-toolbar-item> </dxo-html-editor-toolbar> </dx-html-editor>
export class AppComponent { // ... targetAudiencePrompt() { return 'Based on the text, who is the most likely target audience? Give a short explanation'; } }
Vue
<template> <DxHtmlEditor :ai-integration="aiIntegration" > <DxToolbar> <DxItem name="ai"> <DxCommand name="custom" text="Target Audience" :prompt="targetAudiencePrompt" /> </DxItem> </DxToolbar> </DxHtmlEditor> </template> <script setup lang="ts"> import { DxHtmlEditor, DxToolbar, DxItem, DxCommand } from 'devextreme-vue/html-editor'; // ... const targetAudiencePrompt = () => { return 'Based on the text, who is the most likely target audience? Give a short explanation'; } </script>
React
import React from 'react'; import HtmlEditor, { Toolbar, Item, Command } from 'devextreme-react/html-editor'; const targetAudiencePrompt = () => { return 'Based on the text, who is the most likely target audience? Give a short explanation'; } export default function App() { return ( <HtmlEditor aiIntegration={aiIntegration} > <Toolbar> <Item name="ai"> <Command name="custom" text="Target Audience" prompt={targetAudiencePrompt} /> </Item> </Toolbar> </HtmlEditor> ); }
AITranslateCommand
Specifies a "translate" command for the "ai" toolbar item.
To allow users to use this command, add its name to the commands array:
jQuery
$('.html-editor').dxHtmlEditor({ aiIntegration, toolbar: { items: [ { name: 'ai', commands: [ 'translate', ], }, ], } });
Angular
<dx-html-editor [aiIntegration]="aiIntegration" > <dxo-html-editor-toolbar> <dxi-html-editor-toolbar-item name="ai"> <dxi-html-editor-command name="translate"></dxi-html-editor-command> </dxi-html-editor-toolbar-item> </dxo-html-editor-toolbar> </dx-html-editor>
Vue
<template> <DxHtmlEditor :ai-integration="aiIntegration" > <DxToolbar> <DxItem name="ai"> <DxCommand name="translate" /> </DxItem> </DxToolbar> </DxHtmlEditor> </template> <script setup lang="ts"> import { DxHtmlEditor, DxToolbar, DxItem, DxCommand } from 'devextreme-vue/html-editor'; // ... </script>
React
import React from 'react'; import HtmlEditor, { Toolbar, Item, Command } from 'devextreme-react/html-editor'; export default function App() { return ( <HtmlEditor aiIntegration={aiIntegration} > <Toolbar> <Item name="ai"> <Command name="translate" /> </Item> </Toolbar> </HtmlEditor> ); }
AITranslateOption
Includes all predefined options for the "translate" command.
ContentReadyEvent
The type of the contentReady event handler's argument.
Used in:
Converter
An object that configures converter settings.
DisposingEvent
The type of the disposing event handler's argument.
Used in:
FocusInEvent
The type of the focusIn event handler's argument.
Used in:
FocusOutEvent
The type of the focusOut event handler's argument.
Used in:
HtmlEditorFormat
Specifies a format of the selected content.
HtmlEditorImageUploadMode
Specifies how the HTML Editor UI component uploads files.
HtmlEditorPredefinedContextMenuItem
Configures context menu items.
HtmlEditorPredefinedToolbarItem
Configures toolbar items.
InitializedEvent
The type of the initialized event handler's argument.
Used in:
OptionChangedEvent
The type of the optionChanged event handler's argument.
Used in:
ValueChangedEvent
The type of the valueChanged event handler's argument.
Used in:
If you have technical questions, please create a support ticket in the DevExpress Support Center.