Customize color picker in EJ2 TypeScript Document editor control

22 Mar 20241 minute to read

Document editor provides an options to customize the color picker using colorPickerSettings in Document editor settings. The color picker offers customization options for default appearance, by allowing selection between Picker or Palette mode, for font and border colors.”

Similarly, you can use documentEditorSettings property for DocumentEditor also.

The following example code illustrates how to Customize the color picker in Document editor container.

let container: DocumentEditorContainer = new DocumentEditorContainer({ enableToolbar: true,height: '590px',
  //Customizing options for color picker.
  documentEditorSettings: {
    colorPickerSettings: { mode: 'Palette', modeSwitcher: true, showButtons: true },
  }
});
DocumentEditorContainer.Inject(Toolbar);
container.serviceUrl = 'https://services.syncfusion.com/js/production/api/documenteditor/';
container.appendTo('#container');

The following table illustrates all the possible properties for the color picker.

Property Behaviour
columns It is used to render the ColorPicker palette with specified columns. Defaults to 10
disabled It is used to enable / disable ColorPicker component. If it is disabled the ColorPicker popup won’t open. Defaults to false
mode It is used to render the ColorPicker with the specified mode. Defaults to ‘Picker’
modeSwitcher It is used to show / hide the mode switcher button of ColorPicker component. Defaults to true
showButtons It is used to show / hide the control buttons (apply / cancel) of ColorPicker component. Defaults to true