# How to Customize Sidebar Sections (Home, Pinned, Disks) in Superfile

> Customize Superfile sidebar sections including home, pinned, and disks by editing the sidebar_sections array in your config.toml for a personalized file management experience.

- Repository: [Yorukot/superfile](https://github.com/yorukot/superfile)
- Tags: how-to-guide
- Published: 2026-07-26

---

**You can customize the sidebar sections in Superfile by editing the `sidebar_sections` array in your [`config.toml`](https://github.com/yorukot/superfile/blob/main/config.toml) file to include, exclude, or reorder the "home", "pinned", and "disks" entries.**

Superfile is a terminal-based file manager that renders its left-hand sidebar from a configurable list of sections. To customize sidebar sections in Superfile, you edit the `sidebar_sections` array in your configuration file to control which of the three built-in sections appear and in what order.

## Locating Your Configuration File

Superfile loads its settings from a TOML configuration file at startup. The default location is:

- Linux/macOS: `~/.config/superfile/config.toml`
- Windows: `%APPDATA%\superfile\config.toml`

If this file does not exist, create it manually or allow Superfile to generate a default configuration on first run.

## Valid Sidebar Section Identifiers

The sidebar recognizes three specific section identifiers defined as constants in [`src/pkg/utils/consts.go`](https://github.com/yorukot/superfile/blob/main/src/pkg/utils/consts.go):

- **`home`** – Your user's home directory
- **`pinned`** – Directories you have marked as favorites within Superfile
- **`disks`** – Available system disks and mounted volumes

These strings map to internal logic in [`src/internal/ui/sidebar/directory_utils.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/sidebar/directory_utils.go), where the `appendSection` function collects the appropriate directories for each enabled section.

## Customizing Section Visibility and Order

The `sidebar_sections` field in your [`config.toml`](https://github.com/yorukot/superfile/blob/main/config.toml) accepts a TOML array of strings. You can remove entries to hide sections, rearrange them to change the display order, or use a subset of the available options.

### Show All Sections (Default)

```toml

# ~/.config/superfile/config.toml

sidebar_sections = ["home", "pinned", "disks"]

```

### Hide the Disks Section

```toml

# Show only home and pinned directories

sidebar_sections = ["home", "pinned"]

```

### Reorder Sections

```toml

# Show pinned first, then home, excluding disks

sidebar_sections = ["pinned", "home"]

```

After saving changes to [`config.toml`](https://github.com/yorukot/superfile/blob/main/config.toml), restart Superfile to apply the new sidebar configuration. The `LoadConfigFile` function in [`src/internal/common/load_config.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/load_config.go) reads these values only at initialization.

## Technical Implementation Details

When Superfile initializes, the configuration loader populates the `SidebarSections` field of the `ConfigType` struct defined in [`src/internal/common/config_type.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/config_type.go). According to the Superfile source code, this slice is then accessed by the sidebar model in [`src/internal/ui/sidebar/sidebar.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/sidebar/sidebar.go) via `common.Config.SidebarSections`.

The sidebar renderer iterates over this slice and calls `appendSection` for each entry to build the directory tree. Because the implementation treats `sidebar_sections` as a standard slice, any valid combination or permutation of the three constants will render correctly.

## Programmatic Customization

For developers extending Superfile or users building plugins, you can modify the sidebar sections at runtime via the internal API:

```go
import "github.com/yorukot/superfile/src/internal/common"

func customizeSidebar() {
    // Example: Show only pinned and home sections
    common.Config.SidebarSections = []string{"pinned", "home"}
    
    // Note: Changes take effect immediately in the UI, but to persist 
    // across restarts you must write back to the config file
}

```

This approach modifies the in-memory configuration maintained by the common package. While the runtime change reflects immediately in the sidebar model, persistent customization requires updating the TOML file on disk.

## Summary

- Edit the `sidebar_sections` array in `~/.config/superfile/config.toml` to control sidebar layout
- Valid entries are `"home"`, `"pinned"`, and `"disks"` as defined in [`src/pkg/utils/consts.go`](https://github.com/yorukot/superfile/blob/main/src/pkg/utils/consts.go)
- Remove entries to hide sections entirely, or reorder them to change display priority
- Configuration is processed at startup by `LoadConfigFile` in [`src/internal/common/load_config.go`](https://github.com/yorukot/superfile/blob/main/src/internal/common/load_config.go)
- Runtime modification is possible via `common.Config.SidebarSections` for advanced use cases

## Frequently Asked Questions

### Where does Superfile store the sidebar section configuration?

Superfile stores the `sidebar_sections` setting in the main configuration TOML file, typically located at `~/.config/superfile/config.toml` on Unix systems or `%APPDATA%\superfile\config.toml` on Windows. This path is processed by the config loader at application startup.

### Can I create custom sidebar sections beyond home, pinned, and disks?

No. The current implementation in [`src/pkg/utils/consts.go`](https://github.com/yorukot/superfile/blob/main/src/pkg/utils/consts.go) hardcodes the three valid section identifiers (`home`, `pinned`, `disks`), and the renderer in [`src/internal/ui/sidebar/directory_utils.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/sidebar/directory_utils.go) only implements directory collection logic for these specific types. Adding custom sections would require modifying the source code.

### Why aren't my sidebar changes appearing after editing config.toml?

Superfile reads the configuration file once during initialization through the `LoadConfigFile` function. Unlike some settings that might hot-reload, `sidebar_sections` is processed at startup to build the initial sidebar model in [`src/internal/ui/sidebar/sidebar.go`](https://github.com/yorukot/superfile/blob/main/src/internal/ui/sidebar/sidebar.go). You must restart Superfile for changes to take effect.

### Is it possible to customize sidebar sections programmatically without editing the config file?

Yes. You can modify `common.Config.SidebarSections` at runtime using the Superfile internal API, as demonstrated in the `src/internal/common` package. However, these changes persist only for the current session unless you implement additional logic to write back to the TOML configuration file.