{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-enable-disable-toolbar-item",
  "framework": "react",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "enable-disable-toolbar-item",
  "dependencies": [
    "@syncfusion/ej2-react-filemanager",
    "@syncfusion/ej2-react-buttons"
  ],
  "description": "File manager with external buttons that enable or disable the New Folder toolbar item at runtime.",
  "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/file-manager-enable-disable-toolbar-item.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-enable-disable-toolbar-item/FileManager.tsx",
      "content": "import { DetailsView, FileManagerComponent, NavigationPane, Toolbar, Inject, type ViewType } from '@syncfusion/ej2-react-filemanager';\nimport { ButtonComponent } from '@syncfusion/ej2-react-buttons';\n\n/**\n * File Manager enable or disable a toolbar item sample\n */\nconst EnableDisableToolbarItem = () => {\n  let fileObj: FileManagerComponent;\n  let hostUrl: string = \"https://physical-service.syncfusion.com/\";\n  let height: string = \"330px\";\n  let view: ViewType = \"Details\";\n  let ajaxSettings: object = {\n      downloadUrl: hostUrl + 'api/FileManager/Download',\n      getImageUrl: hostUrl + \"api/FileManager/GetImage\",\n      uploadUrl: hostUrl + 'api/FileManager/Upload',\n      url: hostUrl + \"api/FileManager/FileOperations\"\n  };\n  let toolbarSettings: object = { items: ['NewFolder', 'Refresh', 'View', 'Details'] };\n\n  function onEnable() {\n    fileObj.enableToolbarItems([\"newfolder\"]);\n  }\n  function onDisable() {\n    fileObj.disableToolbarItems([\"newfolder\"]);\n  }\n  return (\n  <div>\n      <ButtonComponent id='enable' onClick={onEnable.bind(this)} cssClass='e-success'>Enable New Folder toolbar item</ButtonComponent>\n      <ButtonComponent id='disable' onClick={onDisable.bind(this)} cssClass='e-danger'>Disable New Folder toolbar item</ButtonComponent>\n      <div className=\"control-section\">\n          <FileManagerComponent ref={ (s: FileManagerComponent | null) => { fileObj = s as FileManagerComponent; }} id=\"file\" height={height} view={view}\n              ajaxSettings = {ajaxSettings}\n              toolbarSettings = {toolbarSettings} >\n                <Inject services={[ NavigationPane, DetailsView, Toolbar]} />\n          </FileManagerComponent>\n      </div>\n  </div>\n  );\n}\nexport default EnableDisableToolbarItem;\n"
    }
  ]
}