How to Hide Toolbar and Properties Pane in React DOCX Editor

27 Aug 20262 minutes to read

Document Editor Container provides the main document view area along with the built-in toolbar and properties pane.

DOCX Editor provides just the main document view area. Here, the user can compose, view, and edit the Word documents. You may prefer to use this component when you want to design your own UI options for your application.

Hide the properties pane

By default, Document Editor Container has built-in properties pane which contains options for formatting text, tables, images, headers, and footers. You can use showPropertiesPane API in DocumentEditorContainer to hide the properties pane.

The following example code illustrates how to hide the properties pane.

import * as ReactDOM from 'react-dom';
import * as React from 'react';
import {
  DocumentEditorContainerComponent,
  Toolbar,
} from '@syncfusion/ej2-react-documenteditor';

DocumentEditorContainerComponent.Inject(Toolbar);
function App() {
  return (
    <DocumentEditorContainerComponent
      id="container"
      height={'590px'}
      serviceUrl="https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/"
      showPropertiesPane={false}
    />
  );
}
export default App;
ReactDOM.render(<App />, document.getElementById('sample'));

The Web API hosted link https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/ utilized in the DOCX Editor’s serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the GitHub Web Service example or Docker image for hosting your own web service and use for the serviceUrl property.

Positioning and customizing the properties pane in the Document Editor Container is not possible. Instead, you can hide the existing properties pane and create your own pane using public APIs.

Hide the toolbar

You can use enableToolbar API in DocumentEditorContainer to hide the existing toolbar.

The following example code illustrates how to hide the existing toolbar.

import * as ReactDOM from 'react-dom';
import * as React from 'react';
import {
  DocumentEditorContainerComponent
} from '@syncfusion/ej2-react-documenteditor';
function App() {
  return (
    <DocumentEditorContainerComponent
      id="container"
      height={'590px'}
      serviceUrl="https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/"
      enableToolbar={false}
    />
  );
}
export default App;
ReactDOM.render(<App />, document.getElementById('sample'));

The Web API hosted link https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/ utilized in the DOCX Editor’s serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the GitHub Web Service example or Docker image for hosting your own web service and use for the serviceUrl property.

See Also