Skip to main content

Configuring panels settings

In the panels mode you can set the panel that will be active in all modes, define the initially opened folder as well as selected folders/files.

Setting the active panel

To define which panel should be active (right or left), you should apply the activePanel property and set its value to 0 (for the left panel, default) or 1 (for the right panel).

Example:

<script>
import { Filemanager } from "@wx/svelte-filemanager";
import { getData, getDrive } from "./common/data";
</script>

<Filemanager
data={getData()}
drive={getDrive()}
activePanel={1} />

Setting the default path

To define the initially opened folder, apply the path parameter of the panels property by settings its values to the required path. The default path is "/".

<script>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@wx/svelte-filemanager";

const panels = [
{
path: "/Code",
selected: ["/Code/Datepicker"],
},
];
</script>

<Filemanager data={getData()} drive={getDrive()} {panels} />

Marking files/folders as selected

To define which files/folders should be marked as selected in the panels mode, apply the selected parameter of the panels property by adding the files/folders paths to the selected array. No items are selected by default.

<script>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@wx/svelte-filemanager";

const panels = [
{
path: "/",
selected: ["/Music", "/Code"],
},
];
</script>

<Filemanager data={getData()} drive={getDrive()} {panels} />

Related samples: Initial path selection