# file-manager-api

> File manager without navigation pane, with toggles for toolbar, file extensions and thumbnails.

**Framework:** react  **Component:** FileManager  **Variant:** api

## 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-api.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-react-filemanager @syncfusion/ej2-react-buttons @syncfusion/ej2-react-dropdowns
```

**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-api/FileManager.tsx

```tsx
import { useState, useRef } from 'react';
import { CheckBoxComponent, type ChangeEventArgs } from '@syncfusion/ej2-react-buttons';
import { DropDownListComponent } from '@syncfusion/ej2-react-dropdowns';
import { FileManagerComponent, Inject, NavigationPane, DetailsView, Toolbar } from '@syncfusion/ej2-react-filemanager';

const defaultcss = `
    #all-property-table .property-panel-section .property-panel-content table#property tr {
        height: 50px;
    }
    @media (max-width: 550px) {
        #rangeSelectionRow {
            display: none;
        }
    }`

/**
 * File Manager API sample
 */
const Api = () => {

    const [isVisible, setIsVisible] = useState<boolean>(true);
    const [isShowFileExtension, setIsShowFileExtension] = useState<boolean>(true);
    const [isShowThumbnail, setShowThumbnail] = useState<boolean>(true);
    const [isEnableRangeSelection, setEnableRangeSelection] = useState<boolean>(true);
    let hostUrl: string = "https://physical-service.syncfusion.com/";
    let fmObj = useRef<FileManagerComponent>(null);
    let disableDropDownList = useRef<DropDownListComponent>(null);
    let enableDropDownList = useRef<DropDownListComponent>(null);
    let items = ['NewFolder', 'Cut', 'Copy', 'Paste', 'Download', 'Delete', 'Refresh', 'Selection', 'View', 'Details'];

    const toolCheck = (args: ChangeEventArgs, id: string): void => {
            if (id == "toolbar") {
                setIsVisible(args.checked as boolean);
            }
            if (id == "fileExtension") {
                setIsShowFileExtension(args.checked as boolean);
            }
            if (id == "thumbnail") {
                setShowThumbnail(args.checked as boolean);
            }
            if (id == "rangeSelection") {
                setEnableRangeSelection(args.checked as boolean);
            }
    }

    const onDisableItemChange = (args: any) => {
        if (args.itemData != null){
            fmObj.current!.disableToolbarItems([args.itemData.value]);
            if(args.value === enableDropDownList.current!.value){
                enableDropDownList.current!.value = null;
            }
        }
    }

    const onEnableItemChange = (args: any) => {
        if (args.itemData != null){
            fmObj.current!.enableToolbarItems([args.itemData.value]);
            if(args.value === disableDropDownList.current!.value){
                disableDropDownList.current!.value = null;
            }
        }
    }

    return(
        <div>
            <style>{defaultcss}</style>
            <div className="col-lg-8 control-section">
                <FileManagerComponent id="api_filemanager" ref={fmObj} ajaxSettings = {{ url: hostUrl + "api/FileManager/FileOperations", getImageUrl: hostUrl + "api/FileManager/GetImage", uploadUrl: hostUrl + 'api/FileManager/Upload', downloadUrl: hostUrl + 'api/FileManager/Download' }} toolbarSettings={{items: ['NewFolder', 'SortBy', 'Cut', 'Copy', 'Paste', 'Delete', 'Refresh', 'Download', 'Rename', 'Selection', 'View', 'Details'], visible: isVisible}} contextMenuSettings={{file: [ 'Cut', 'Copy', '|', 'Delete', 'Download', 'Rename', '|', 'Details'], layout: ['SortBy', 'View', 'Refresh', '|', 'Paste', '|', 'NewFolder', '|', 'Details', '|', 'SelectAll'], visible: true }} view={"LargeIcons"} navigationPaneSettings={{visible: false}} allowMultiSelection={true} showFileExtension={isShowFileExtension} showThumbnail={isShowThumbnail} enableRangeSelection={isEnableRangeSelection}>
                    <Inject services={[ NavigationPane, DetailsView, Toolbar]} />
                </FileManagerComponent>
            </div>
            <div id="all-property-table" className='col-lg-4 property-section'>
                <div className="property-panel-section">
                    <div className="property-panel-header">Properties</div>
                    <div className="property-panel-content">
                        <table id="property" title="Properties" className='property-panel-table' style={{ width: "100%" }}>
                            <tbody>
                                <tr>
                                    <td style={{ width: '50%' }}>
                                        <div style={{ fontSize : '14px', paddingLeft: '0px' }}>Enable Range Selection</div>
                                    </td>
                                    <td style={{ width: '50%', paddingRight: '10px' }}>
                                        <div>
                                            <CheckBoxComponent id="rangeSelection" checked={true} change={(args) => toolCheck(args, "rangeSelection")}></CheckBoxComponent>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style={{ width: '50%' }}>
                                        <div style={{ fontSize : '14px', paddingLeft: '0px' }}>Toolbar</div>
                                    </td>
                                    <td style={{ width: '50%', paddingRight: '10px' }}>
                                        <div>
                                            <CheckBoxComponent id="toolbar" checked={true} change={(args) => toolCheck(args, "toolbar")}></CheckBoxComponent>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style={{ width: '50%' }}>
                                        <div style={{ fontSize : '14px', paddingLeft: '0px' }}>Show File Extension</div>
                                    </td>
                                    <td style={{ width: '50%', paddingRight: '10px' }}>
                                        <div>
                                            <CheckBoxComponent id="fileExtension" checked={true} change={(args) => toolCheck(args, "fileExtension")}></CheckBoxComponent>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style={{ width: '50%' }}>
                                        <div style={{ fontSize : '14px', paddingLeft: '0px' }}>Show Thumbnail</div>
                                    </td>
                                    <td style={{ width: '50%', paddingRight: '10px' }}>
                                        <div>
                                            <CheckBoxComponent id="thumbnail" checked={true} change={(args) => toolCheck(args, "thumbnail")}></CheckBoxComponent>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style={{ width: '50%' }}>
                                        <div style={{ fontSize : '14px', paddingLeft: '0px' }}>Disable Toolbar Item</div>
                                    </td>
                                    <td style={{ width: '50%', paddingLeft: '10px' }}>
                                        <div>
                                            <DropDownListComponent ref={disableDropDownList} id="disable" dataSource={items} change={onDisableItemChange.bind(this)}></DropDownListComponent>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style={{ width: '50%' }}>
                                        <div style={{ fontSize : '14px', paddingLeft: '0px' }}>Enable Toolbar Item</div>
                                    </td>
                                    <td style={{ width: '50%', paddingLeft: '10px' }}>
                                        <div>
                                            <DropDownListComponent ref={enableDropDownList} id="enable" dataSource={items} change={onEnableItemChange.bind(this)}></DropDownListComponent>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    );
}
export default Api;

```
