{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "file-manager-template",
  "framework": "javascript",
  "type": "registry:component",
  "component": "FileManager",
  "variant": "template",
  "dependencies": [
    "@syncfusion/ej2-filemanager",
    "@syncfusion/ej2-splitbuttons"
  ],
  "description": "File manager with templated navigation pane, card-style large icons and custom details columns.",
  "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/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/file-manager-template.md"
  },
  "files": [
    {
      "target": "src/components/file-manager-template/file-manager.html",
      "content": "<div class=\"control-section\">\n    <div class=\"sample-container\">\n        <!-- Initialize FileManager -->\n        <div id=\"container\"></div>\n    </div>\n</div>\n\n<style>\n\n    .e-filemanager.e-fm-template-sample .e-list-icon {\n        height: 20px !important;\n        margin: 0 !important;\n        width: 20px !important;\n    }\n\n    .e-dropdown-btn.filemanager-dropdown-button {\n        border: none;\n        margin-right: -6px;\n        box-shadow: none;\n        background: transparent;\n    }\n\n    .e-dropdown-btn.filemanager-dropdown-button:hover, .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover {\n        background: #d4d4d4;\n    }\n\n    .fluent2-dark .e-dropdown-btn.filemanager-dropdown-button:hover, .fluent2-dark .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover,\n    .fluent-dark .e-dropdown-btn.filemanager-dropdown-button:hover, .fluent-dark .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover,\n    .material3-dark .e-dropdown-btn.filemanager-dropdown-button:hover, .material3-dark .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover,\n    .tailwind3-dark .e-dropdown-btn.filemanager-dropdown-button:hover, .tailwind3-dark .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover,\n    .fluent2-highcontrast .e-dropdown-btn.filemanager-dropdown-button:hover, .fluent2-highcontrast .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover,\n    .highcontrast .e-dropdown-btn.filemanager-dropdown-button:hover, .highcontrast .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover,\n    .bootstrap5\\.3-dark .e-dropdown-btn.filemanager-dropdown-button:hover, .bootstrap5\\.3-dark .e-dropdown-btn.filemanager-dropdown-button.e-btn:hover {\n        background: #3d3d3d;\n    }\n\n    .bootstrap5\\.3 .e-dropdown-btn.filemanager-dropdown-button {\n        color: #242424;\n    }\n\n    .e-filemanager.e-fm-template-sample .e-grid .e-gridheader .e-fe-grid-icon + .e-rowcell, .e-filemanager .e-grid .e-gridheader .e-fe-grid-icon + .e-headercell, .e-filemanager .e-grid .e-gridcontent .e-fe-grid-icon + .e-rowcell, .e-filemanager .e-grid .e-gridcontent .e-fe-grid-icon + .e-headercell {\n        padding-left: 6px;\n    }\n\n    .e-fm-template-sample .e-nav-pane-node .e-icons {\n        font-size: larger;\n    }\n\n    .e-fm-template-sample .custom-icon-card {\n        padding: 8px;\n        border: 1px solid #ccc;\n        border-radius: 10px;\n        height: 100%;\n        box-sizing: border-box;\n        display: flex;\n        flex-direction: column;\n        justify-content: flex-start;\n        align-items: center;\n    }\n\n    .e-fm-template-sample .file-header {\n        display: flex;\n        justify-content: space-between;\n        align-items: center;\n        width: 100%;\n        margin-bottom: 10px;\n    }\n\n    .e-fm-template-sample .left-info {\n        display: flex;\n        align-items: center;\n        gap: 8px;\n        overflow: hidden;\n        flex-shrink: 1;\n        flex-grow: 1;\n    }\n\n    .e-fm-template-sample .file-name {\n        font-size: 14px;\n        font-weight: 600;\n        white-space: nowrap;\n        overflow: hidden;\n        text-overflow: ellipsis;\n        max-width: 160px;\n    }\n\n    .e-fm-template-sample .file-formattedDate {\n        font-size: 12px;\n        margin-top: 8px;\n        text-align: center;\n        font-weight: 600;\n    }\n\n    .e-filemanager.e-fm-template-sample.e-fe-mobile .e-large-icons .e-list-parent .e-list-item {\n        height: 185px;\n        width: 100px;\n        margin: 8px 4px;\n    }\n\n    .e-filemanager.e-fm-template-sample.e-fe-mobile .e-large-icons .e-list-parent .e-list-item .file-icon {\n        width: 150px;\n        height: 90px;\n    }\n\n    .e-filemanager.e-fm-template-sample.e-fe-mobile .e-large-icons .e-list-parent .e-list-item .file-name {\n        max-width: 100px;\n    }\n\n    .e-filemanager.e-fm-template-sample .e-large-icons .e-list-item {\n        height: 230px;\n        width: 200px;\n    }\n    #container.e-fm-template-sample .e-layout-content {\n        overflow: hidden;\n    }\n\n    .e-filemanager.e-fm-template-sample .e-large-icons .e-list-parent .e-list-item .file-icon {\n        width: 190px;\n        height: 150px;\n        background-repeat: no-repeat;\n        background-position: center center;\n        background-size: contain;\n        margin-bottom: 10px;\n    }\n\n    .tailwind3 .e-filemanager.e-fm-template-sample .e-treeview .e-text-content,\n    .tailwind3-dark .e-filemanager.e-fm-template-sample .e-treeview .e-text-content {\n        top: 0;\n    }\n    .e-filemanager.e-fm-template-sample .e-treeview .e-list-text {\n        display: inline-flex;\n    }\n\n    .background-folder { background-image: url('/file-manager/template/folders.svg'); }\n    .background-png { background-image: url('/file-manager/template/image-png.svg'); }\n    .background-pptx { background-image: url('/file-manager/template/pptx.png'); }\n    .background-jpg { background-image: url('/file-manager/template/image-jpg.svg'); }\n    .background-doc { background-image: url('/file-manager/template/docx.png'); }\n    .background-pdf { background-image: url('/file-manager/template/pdfphoto.png'); }\n    .background-txt { background-image: url('/file-manager/template/text.png'); }\n    .background-video { background-image: url('/file-manager/template/video.png'); }\n    .background-audio { background-image: url('/file-manager/template/music.png'); }\n    .background-xlsx { background-image: url('/file-manager/template/xlsx.png'); }\n    .background-zip { background-image: url('/file-manager/template/zip.svg'); }\n\n    /* People */\n    .background-Adam { background-image: url('/file-manager/template/Adam.png'); }\n    .background-Andrew { background-image: url('/file-manager/template/Andrew.png'); }\n    .background-Ellie { background-image: url('/file-manager/template/Ellie.png'); }\n    .background-Jameson { background-image: url('/file-manager/template/Jameson.png'); }\n    .background-John { background-image: url('/file-manager/template/John.png'); }\n    .background-Josie { background-image: url('/file-manager/template/Josie.png'); }\n\n    /* Food */\n    .background-Applepie { background-image: url('/file-manager/template/Apple pie.png'); }\n    .background-Bread { background-image: url('/file-manager/template/Bread.png'); }\n    .background-Doughnut { background-image: url('/file-manager/template/Doughnut.png'); }\n    .background-Nuggets { background-image: url('/file-manager/template/Nuggets.png'); }\n    .background-Sugarcookie { background-image: url('/file-manager/template/Sugar cookie.png'); }\n\n    /* Nature */\n    .background-bird { background-image: url('/file-manager/template/bird.jpg'); }\n    .background-sea { background-image: url('/file-manager/template/sea.jpg'); }\n    .background-seaview { background-image: url('/file-manager/template/seaview.jpg'); }\n    .background-snow { background-image: url('/file-manager/template/snow.jpg'); }\n    .background-snowfall { background-image: url('/file-manager/template/snowfall.jpg'); }\n</style>\n"
    },
    {
      "target": "src/components/file-manager-template/file-manager.ts",
      "content": "import { FileManager, DetailsView, NavigationPane, Toolbar } from '@syncfusion/ej2-filemanager';\nimport { DropDownButton, type ItemModel } from '@syncfusion/ej2-splitbuttons';\nFileManager.Inject(Toolbar, NavigationPane, DetailsView);\n\n/**\n * File Manager template sample\n */\nexport function initFileManagerTemplate(): void {\n    const actionItems: ItemModel[] = [\n        { text: 'Open', iconCss: 'e-icons e-folder-open' },\n        { text: 'Download', iconCss: 'e-icons e-download' },\n        { text: 'Refresh', iconCss: 'e-icons e-refresh' },\n        { text: 'Delete', iconCss: 'e-icons e-trash' },\n    ];\n    const hostUrl: string = 'https://physical-service.syncfusion.com/';\n\n    const fileManager = new FileManager({\n        ajaxSettings: {\n            url: `${hostUrl}api/FileManager/FileOperations`,\n            uploadUrl: `${hostUrl}api/FileManager/Upload`,\n            downloadUrl: `${hostUrl}api/FileManager/Download`,\n            getImageUrl: `${hostUrl}api/FileManager/GetImage`\n        },\n        cssClass: 'e-fm-template-sample',\n        height: '600px',\n        detailsViewSettings: {\n            columns: [\n                {\n                    field: \"name\",\n                    headerText: \"Name\",\n                    template: (item: any) => {\n                        return `<div>${item.name}</div>`;\n                    }\n                },\n                {\n                    field: 'size',\n                    headerText: 'Size', \n                    template: (item: any) => {\n                        return `<div>${item.isFile ? formatSize(item.size) : \"-\"}</div>`;\n                    }\n                },\n                {\n                    field: '_fm_modified', headerText: 'DateModified', format: 'MM/dd/yyyy hh:mm a'\n                },\n                {\n                    headerText: \"Actions\",\n                    template: (item: any) => {\n                        return `\n                            <div class=\"action-ddb\" data-name=\"${item.name}\" data-isFile=\"${item.isFile}\"></div>\n                        `;\n                    }\n                }\n            ]\n        },\n        largeIconsTemplate: (item: any): string => {\n            const formattedDate = item.dateCreated\n                ? new Date(item.dateCreated).toLocaleDateString('en-US', {\n                    year: 'numeric',\n                    month: 'long',\n                    day: 'numeric'\n                })\n                : '';\n            const iconClass = getFileIconCssClass(item);\n            const backgroundClass = getBackgroundCss(item);\n            const iconHtml = item.isFile ? `<div class=\"${iconClass}\"></div>` : '';\n            return `\n                <div class=\"custom-icon-card\">\n                    <div class=\"file-header\">\n                        <div class=\"left-info\">\n                            ${iconHtml}\n                            <div class=\"file-name\" title=\"${item.name}\">${item.name}</div>\n                        </div>\n                        <div class=\"action-ddb\" data-name=\"${item.name}\" data-isFile=\"${item.isFile}\"></div>\n                    </div>\n                    <div class=\"${backgroundClass}\" title=\"${item.name}\"></div>\n                    <div class=\"file-formattedDate\">Created on ${formattedDate}</div>\n                </div>\n            `;\n        },\n        navigationPaneTemplate: (item: any): string => {\n            const iconClass = getIconsForFolders(item);\n            return `\n                <div class=\"e-nav-pane-node\" style=\"display: inline-flex; align-items: center;\">\n                    <span class=\"e-icons ${iconClass}\"></span>\n                    <span class=\"folder-name\" style=\"margin-left:8px;\">${item.name}</span>\n                </div>\n            `;\n        },\n        menuOpen: (args: any) => {\n            args.cancel = true;\n        },\n        fileLoad: (args: any) => {\n            const validModules = ['DetailsView', 'LargeIconsView'];\n\n            if (validModules.indexOf(args.module) !== -1) {\n                const actionBtn = args.element.querySelector('.action-ddb') as HTMLElement;\n\n                if (actionBtn && !actionBtn.hasAttribute('data-ddb-initialized')) {\n                    wireDropDownButton(actionBtn);\n                }\n            }\n        },\n    });\n\n    fileManager.appendTo('#container');\n\n    function wireDropDownButton(hostEl: HTMLElement) {\n        const fileName = hostEl.getAttribute('data-name') || '';\n        const isFile = (hostEl.getAttribute('data-isfile') || 'false') === 'true';\n        const items = isFile ? actionItems.filter((i) => i.text !== 'Open') : actionItems;\n        const ddb = new DropDownButton({\n            items: items,\n            cssClass: 'e-caret-hide filemanager-dropdown-button',\n            select: (args) => {\n                const action = args.item.text || '';\n                onActionSelect(action, { name: fileName, isFile });\n            },\n            iconCss: 'e-icons e-more-vertical-1',\n        });\n        ddb.appendTo(hostEl);\n        hostEl.setAttribute('data-ddb-initialized', 'true');\n    }\n\n    function onActionSelect(action: string, item: { name: string; isFile: boolean }) {\n        switch (action) {\n            case 'Open':\n                fileManager.openFile(item.name);\n                break;\n            case 'Download':\n                fileManager.downloadFiles([item.name]);\n                break;\n            case 'Refresh':\n                fileManager.refreshFiles();\n                break;\n            case 'Delete':\n                fileManager.deleteFiles([item.name]);\n                break;\n            default:\n                break;\n        }\n    }\n\n    function formatSize(bytes: number): string {\n        if (!bytes) return \"0 B\";\n        const sizes = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\"];\n        let i = 0;\n        while (bytes >= 1024 && i < sizes.length - 1) {\n            bytes /= 1024;\n            i++;\n        }\n        return `${bytes.toFixed(1)} ${sizes[i]}`;\n    }\n\n    function getBackgroundCss(item: any): string {\n        const NamedFileBackgrounds: Record<string, string> = {\n            \"Adam.png\": \"background-Adam\",\n            \"Andrew.png\": \"background-Andrew\",\n            \"Ellie.png\": \"background-Ellie\",\n            \"Jameson.png\": \"background-Jameson\",\n            \"John.png\": \"background-John\",\n            \"Josie.png\": \"background-Josie\",\n            \"Apple pie.png\": \"background-Applepie\",\n            \"Bread.png\": \"background-Bread\",\n            \"Doughnut.png\": \"background-Doughnut\",\n            \"Nuggets.png\": \"background-Nuggets\",\n            \"Sugar cookie.png\": \"background-Sugarcookie\",\n            \"bird.jpg\": \"background-bird\",\n            \"sea.jpg\": \"background-sea\",\n            \"seaview.jpg\": \"background-seaview\",\n            \"snow.jpg\": \"background-snow\",\n            \"snowfall.jpg\": \"background-snowfall\"\n        };\n\n        const ExtensionBackgrounds: Record<string, string> = {\n            \"jpg\": \"background-jpg\",\n            \"jpeg\": \"background-jpg\",\n            \"png\": \"background-png\",\n            \"pptx\": \"background-pptx\",\n            \"pdf\": \"background-pdf\",\n            \"mp4\": \"background-video\",\n            \"mp3\": \"background-audio\",\n            \"docx\": \"background-doc\",\n            \"txt\": \"background-txt\",\n            \"xlsx\": \"background-xlsx\",\n            \"zip\": \"background-zip\"\n        };\n\n        if (!item.isFile) return \"file-icon background-folder\";\n        if (NamedFileBackgrounds[item.name]) return `file-icon ${NamedFileBackgrounds[item.name]}`;\n        const ext = item.name.split('.').pop() || '';\n        return `file-icon ${ExtensionBackgrounds[ext] || \"background-default\"}`;\n    }\n\n    function getIconsForFolders(item: any): string {\n        const iconMap: Record<string, string> = {\n            Files: 'e-folder',\n            Documents: 'e-file-document',\n            Downloads: 'e-download',\n            Pictures: 'e-thumbnail',\n            Music: 'e-file-format',\n            Videos: 'e-video',\n            Employees: 'e-export-png',\n            Food: 'e-export-png',\n            Nature: 'e-export-png'\n        };\n        return iconMap[item.name] || 'e-folder';\n    }\n\n    function getFileIconCssClass(item: any): string {\n        if (!item.isFile) return \"\";\n\n        const extensionMap: Record<string, string> = {\n            jpg: \"image\",\n            jpeg: \"image\",\n            png: \"image\",\n            gif: \"image\",\n            mp3: \"music\",\n            wav: \"music\",\n            mp4: \"video\",\n            avi: \"video\",\n            doc: \"doc\",\n            docx: \"docx\",\n            ppt: \"pptx\",\n            pptx: \"pptx\",\n            xls: \"xlsx\",\n            xlsx: \"xlsx\",\n            txt: \"txt\",\n            js: \"js\",\n            css: \"css\",\n            html: \"html\",\n            exe: \"exe\",\n            msi: \"msi\",\n            php: \"php\",\n            xml: \"xml\",\n            zip: \"zip\",\n            rar: \"rar\",\n            pdf: \"pdf\"\n        };\n\n        const extension = (item.name.split('.').pop() || \"\").toLowerCase();\n        const iconType = extensionMap[extension] || \"unknown\";\n        return `e-list-icon e-fe-${iconType}`;\n    }\n}\n"
    }
  ]
}