# file-manager-custom-toolbar-items

> File manager toolbar with a modified New Folder item and a custom Select All checkbox item.

**Framework:** react  **Component:** FileManager  **Variant:** custom-toolbar-items

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/react/ts/file-manager-custom-toolbar-items.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-react-filemanager @syncfusion/ej2-react-buttons
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/file-manager-custom-toolbar-items/FileManager.tsx

```tsx
import { DetailsView, FileManagerComponent, NavigationPane, Toolbar, Inject, ToolbarItemsDirective, ToolbarItemDirective, type ViewType } from '@syncfusion/ej2-react-filemanager';
import { CheckBoxComponent, type ChangeEventArgs } from '@syncfusion/ej2-react-buttons';

/**
 * File Manager custom toolbar items sample
 */
const CustomToolbarItems = () => {
  let fileObj: FileManagerComponent;
  let checkbox: CheckBoxComponent;
  let hostUrl: string = "https://physical-service.syncfusion.com/";
  let height: string = "375px";
  let view: ViewType = "Details";
  let ajaxSettings: object = {
      downloadUrl: hostUrl + 'api/FileManager/Download',
      getImageUrl: hostUrl + "api/FileManager/GetImage",
      uploadUrl: hostUrl + 'api/FileManager/Upload',
      url: hostUrl + "api/FileManager/FileOperations"
  };

  function checkboxTemplate() {
    return (
      <CheckBoxComponent ref={ (scope: CheckBoxComponent | null) => { checkbox = scope as CheckBoxComponent; }} label="Select All" checked={false} change={onChange} />
    );
  }

  function onChange(args: ChangeEventArgs) {
    if (args.checked) {
      fileObj.selectAll();
      checkbox.label = 'Unselect All';
    }
    else {
      fileObj.clearSelection();
      checkbox.label = 'Select All';
    }
  }
  return (
  <div>
      <div className="control-section">
          <FileManagerComponent ref={ (s: FileManagerComponent | null) => { fileObj = s as FileManagerComponent; }} id="file" view={view} height={height}
              ajaxSettings = {ajaxSettings}>
                <ToolbarItemsDirective>
                    <ToolbarItemDirective name= 'NewFolder' text= 'Create folder' prefixIcon= 'e-plus' tooltipText= 'Create folder'/>
                    <ToolbarItemDirective name= 'Upload'/>
                    <ToolbarItemDirective name= 'SortBy'/>
                    <ToolbarItemDirective name= 'Refresh'/>
                    <ToolbarItemDirective name= 'Cut'/>
                    <ToolbarItemDirective name= 'Copy'/>
                    <ToolbarItemDirective name= 'Paste'/>
                    <ToolbarItemDirective name= 'Delete'/>
                    <ToolbarItemDirective name= 'Download'/>
                    <ToolbarItemDirective name= 'Rename'/>
                    <ToolbarItemDirective name= 'Select' template={checkboxTemplate}/>
                    <ToolbarItemDirective name= 'Selection'/>
                    <ToolbarItemDirective name= 'View'/>
                    <ToolbarItemDirective name= 'Details'/>
                </ToolbarItemsDirective>
                <Inject services={[ NavigationPane, DetailsView, Toolbar]} />
          </FileManagerComponent>
      </div>
  </div>
  );
}
export default CustomToolbarItems;

```
