show-preview
Description
Fires when the visibility of the Preview panel changesUsage
"show-preview": ({
mode: boolean
}) => boolean | void;
Parameters
The callback of the show-preview action takes an object with the following parameters:
mode- it's set to false to hide the file preview panel (default); set to true, to show the preview
Example
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@svar-ui/react-filemanager";
function App() {
function init(api) {
api.on("show-preview", ({ mode }) => {
console.log(`Preview is ${mode ? "visible" : "hidden"}`);
});
}
return <Filemanager data={getData()} drive={getDrive()} init={init} />;
}
export default App;
Related articles: How to access File Manager API