{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "docx-editor-default",
  "framework": "react",
  "type": "registry:component",
  "component": "DocxEditor",
  "variant": "default",
  "dependencies": [
    "@syncfusion/ej2-react-documenteditor",
    "@syncfusion/ej2-react-buttons"
  ],
  "description": "Word editor provides document editing with switchable Ribbon or toolbar layouts.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": true,
    "platformIndex": "https://ai.syncfusion.com/react/llms.txt",
    "skillPack": "syncfusion/react-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/react/ts/docx-editor-default.md"
  },
  "files": [
    {
      "target": "src/components/docx-editor-default/DocxEditor.tsx",
      "content": "import { useEffect, useRef } from 'react';\nimport { DocumentEditorContainerComponent, Ribbon, Toolbar } from '@syncfusion/ej2-react-documenteditor';\nimport { SwitchComponent } from '@syncfusion/ej2-react-buttons';\nimport { defaultDocument } from '../datasource/docx-editor-data';\n\nDocumentEditorContainerComponent.Inject(Toolbar, Ribbon);\n\nconst SAMPLE_CSS = `\n.flex-container {\n    display: flex;\n    justify-content: flex-end;\n    align-items: center;\n}\n\n.render-mode-info {\n    background: none;\n    border: none;\n    padding-left: 0px;\n}\n\n.render-mode-info .render-mode-info-icon {\n    height: 16px;\n    width: 16px;\n}\n\n.switchLabel {\n    font-family: \"Segoe UI\", \"GeezaPro\", \"DejaVu Serif\", sans-serif;\n    font-weight: 400;\n    line-height: 20px;\n    letter-spacing: 0.24px;\n    text-align: right;\n    font-size: 14px;\n    margin-bottom: 3px;\n}\n\n.render-mode-info .render-mode-info-icon::before {\n    line-height: normal;\n}\n\n.buttonSwitch {\n    Width: 40px;\n    Height: 24px;\n}\n\nbody {\n    margin: 0;\n    height: 100%;\n    width: 100%;\n    overflow: hidden;\n}`;\n\nconst Default = () => {\n    useEffect(() => {\n        rendereComplete();\n    }, []);\n    let hostUrl: string =\n        \"https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/\";\n    let container = useRef<DocumentEditorContainerComponent>(null);\n    const onLoadDefault = (): void => {\n        if (!container.current) return;\n        container.current.documentEditor.open(JSON.stringify(defaultDocument));\n        container.current.documentEditor.documentName = \"Getting Started\";\n        container.current.documentChange = (): void => {\n            container.current?.documentEditor.focusIn();\n        };\n    };\n    const rendereComplete = (): void => {\n        if (!container.current) return;\n        container.current.documentEditor.pageOutline = \"#E0E0E0\";\n        container.current.documentEditor.acceptTab = true;\n        container.current.documentEditor.resize();\n        onLoadDefault();\n    };\n    const change = (args: any): void => {\n        if (!container.current) return;\n        if (args.checked) {\n            container.current.toolbarMode = 'Ribbon';\n        }\n        else {\n            container.current.toolbarMode = 'Toolbar';\n        }\n    }\n    return (\n        <div className=\"control-pane\">\n            <style>{SAMPLE_CSS}</style>\n            <div className=\"control-section\">\n                <div className=\"flex-container\">\n                    <label className=\"switchLabel\" htmlFor=\"toolbarSwitch\">Ribbon UI</label>\n                    <div className=\"e-message render-mode-info\">\n                        <span className=\"e-msg-icon render-mode-info-icon\" title=\"Turn OFF to switch from Ribbon to toolbar UI\"></span>\n                    </div>\n                    <SwitchComponent cssClass=\"buttonSwitch\" id=\"toolbarSwitch\" change={change} checked={true}></SwitchComponent>\n                </div>\n                <div id=\"documenteditor_container_body\">\n                    <DocumentEditorContainerComponent\n                        id=\"container\"\n                        ref={container}\n                        style={{ display: \"block\" }}\n                        height={\"590px\"}\n                        toolbarMode= {\"Ribbon\"}\n                        serviceUrl={hostUrl}\n                        enableToolbar={true}\n                        locale=\"en-US\"\n                    />\n                </div>\n            </div>\n        </div>\n    );\n}\nexport default Default;\n"
    }
  ]
}