# file-manager-tooltip-customization

> File manager that customizes item tooltips to show the file name and modified date on hover.

**Framework:** react  **Component:** FileManager  **Variant:** tooltip-customization

## 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-tooltip-customization.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-react-filemanager @syncfusion/ej2-react-popups
```

**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-tooltip-customization/FileManager.tsx

```tsx
import { DetailsView, FileManagerComponent, NavigationPane, Toolbar, Inject } from '@syncfusion/ej2-react-filemanager';
import { getValue, select } from '@syncfusion/ej2-base';
import { TooltipComponent, type TooltipEventArgs } from '@syncfusion/ej2-react-popups';

/**
 * File Manager tooltip customization sample
 */
const TooltipCustomization = () => {
    let fileObj: FileManagerComponent;
    let tooltipObj: TooltipComponent;
    let hostUrl: string = "https://physical-service.syncfusion.com/";
    let height: string = "375px";
    let ajaxSettings: object = {
        downloadUrl: hostUrl + 'api/FileManager/Download',
        getImageUrl: hostUrl + "api/FileManager/GetImage",
        uploadUrl: hostUrl + 'api/FileManager/Upload',
        url: hostUrl + "api/FileManager/FileOperations"
    };
    function onTooltipBeforeRender(args: TooltipEventArgs): void {
      const buttonId: string = select('button', args.target).id;
      let description: string = '';
        switch (buttonId) {
            case fileObj.element.id + '_tb_newfolder':
                description = 'Create a new folder';
                break;
            case fileObj.element.id + '_tb_upload':
                description = 'Upload new files';
                break;
            case fileObj.element.id + '_tb_cut':
                description = 'Cut files and folders from the current location';
                break;
            case fileObj.element.id + '_tb_copy':
                description = 'Copy files and folders from the current location';
                break;
            case fileObj.element.id + '_tb_paste':
                description = 'Paste files and folders in the current location';
                break;
            case fileObj.element.id + '_tb_delete':
                description = 'Delete selected files and folders';
                break;
            case fileObj.element.id + '_tb_download':
                description = 'Download selected files and folders';
                break;
            case fileObj.element.id + '_tb_rename':
                description = 'Rename selected file or folder';
                break;
            case fileObj.element.id + '_tb_sortby':
                description = 'Change the file sorting order';
                break;
            case fileObj.element.id + '_tb_refresh':
                description = 'Refresh the current location';
                break;
            case fileObj.element.id + '_tb_selection':
                description = 'Following items are currently selected:';
                for (let i: number = 0; i < fileObj.selectedItems.length; i++) {
                    description = description + '</br>' + fileObj.selectedItems[i];
                }
            break;
            case fileObj.element.id + '_tb_view':
                description = 'Switch the layout view';
                break;
            case fileObj.element.id + '_tb_details':
                description = 'Get the details of the seletced items';
                break;
            default:
                description = '';
                break;
        }
      tooltipObj.content = args.target.getAttribute('title') + '</br>' + description;
    }
    function fileLoad(args: any): void {
      const target: Element = args.element;
      if (args.module==='DetailsView') {
          const element: Element = select('[title]', args.element);
          const title: string = getValue('name', args.fileDetails) +
              '\n' + getValue('dateModified', args.fileDetails);
          element.setAttribute('title', title);
      } else if (args.module==='LargeIconsView') {
          const title: string = getValue('name', args.fileDetails) +
              '\n' + getValue('dateModified', args.fileDetails);
          target.setAttribute('title', title);
      }
    }

    return (
        <div>
            <div className="control-section">
                <TooltipComponent id="template-tootip" ref={ (s: TooltipComponent | null) => { tooltipObj = s as TooltipComponent; }} target="#file_toolbar [title]" beforeRender={onTooltipBeforeRender} >
                    <div className="filemanager-container">
                    {/* File Manager element */}
                        <FileManagerComponent ref={ (s: FileManagerComponent | null) => { fileObj = s as FileManagerComponent; }} id="file" height={height}
                            ajaxSettings={ajaxSettings} fileLoad={fileLoad}>
                            <Inject services={[ NavigationPane, DetailsView, Toolbar]} />
                        </FileManagerComponent>
                    </div>
                </TooltipComponent>
            </div>
        </div>
    );
}
export default TooltipCustomization;

```
