You are correct, the file‑type icons (pdf, jpg, doc, …) are not part of the wx-icons font. The font provides only the UI icons (arrows, folder, file, etc.) and the tree view folder icon. The specific file‑type icons are separate SVG files loaded from the CDN.
To keep the original look everywhere (tree view + main pane) without any CDN requests, you need both the local fonts and a custom icons function that points to local copies of the original file‑type SVGs.
Keep the local fonts (you already did this)
Ensure your local wx-icons and Open Sans are loading correctly. Your CSS override should be imported after the library styles.
Download the file‑type SVGs
The Filemanager loads these from https://cdn.svar.dev/icons/filemanager/vivid/{size}/{icon}.svg, where {size} is bigor small, and {icon} is one of the supported extensions.
Supported extensions:
7z, rar, zip, css, html, js, php, md, xml, sql, aif, mid, mp3, waw, wma, doc, docx, txt, avi, mov, mp4, mpeg, mpg, pdf, xls, xlsx, gif, jpg, jpeg, png, psd, tiff, svg, file.
Download each of them from the CDN for both big and small sizes, and place them in your project
- Write a local
icons function and pass it to the component
This function will return the path to your local SVGs instead of the CDN. It should return false for folders (so the font icon is used).
For example:
const localIcons = (file, size) => {
if (file.type === "folder") return false;
const whitelist = {
"7z":1, rar:1, zip:1, css:1, html:1, js:1, php:1, md:1, xml:1, sql:1,
aif:1, mid:1, mp3:1, waw:1, wma:1, doc:1, docx:1, txt:1,
avi:1, mov:1, mp4:1, mpeg:1, mpg:1, pdf:1, xls:1, xlsx:1,
gif:1, jpg:1, jpeg:1, png:1, psd:1, tiff:1, svg:1
};
const { ext, type } = file;
let icon;
if (type && type !== "file" && whitelist[type]) {
icon = type;
} else if (ext) {
icon = whitelist[ext.toLowerCase()] ? ext.toLowerCase() : "file";
} else {
icon = "unknown";
}
return `/icons/vivid/${size}/${icon}.svg`;
};
<FileManager data={data} icons={localIcons} />
Please try this approach. If anything still doesn’t work, let me know exactly what you’re seeing and I’ll try to help you.