Chonky v2.1.0 Docs
IntroductionInstallation & usageFile Browser demosMigrating from 1.xFAQ
Basics

Built-in actions

Note that EssentialActions, DefaultActions and ExtraActions as combined into a single object called ChonkyActions:

export const ChonkyActions = {
...EssentialActions,
...DefaultActions,
...ExtraActions,
};

This object is exported directly from chonky:

import { ChonkyActions } from 'chonky';
console.log(ChonkyActions.OpenFiles);

See Built-in actions page for more info.

EssentialActions Object literal

Source code on GitHub: src/action-definitions/essential.ts

MouseClickFile:FileAction
Variable

Action that is dispatched when the user clicks on a file entry using their mouse. Both single clicks and double clicks trigger this action.

type MouseClickFilePayload = {
altKey: boolean;
clickType: 'single' | 'double';
ctrlKey: boolean;
file: FileData;
fileDisplayIndex: number;
shiftKey: boolean;
}
KeyboardClickFile:FileAction
Variable

Action that is dispatched when the user "clicks" on a file using their keyboard. Using Space and Enter keys counts as clicking.

type KeyboardClickFilePayload = {
altKey: boolean;
ctrlKey: boolean;
enterKey: boolean;
file: FileData;
fileDisplayIndex: number;
shiftKey: boolean;
spaceKey: boolean;
}
StartDragNDrop:FileAction
Variable

Action that is dispatched when user starts dragging some file.

type StartDragNDropPayload = {
draggedFile: FileData;
selectedFiles: FileData[];
source: Nullable<FileData>;
sourceInstanceId: string;
}
EndDragNDrop:FileAction
Variable

Action that is dispatched when user either cancels the drag & drop interaction, or drops a file somewhere.

type EndDragNDropPayload = StartDragNDropPayload & {
copy: boolean;
destination: FileData;
}
MoveFiles:FileAction
Variable

Action that is dispatched when user moves files from one folder to another, usually by dragging & dropping some files into the folder.

type MoveFilesPayload = EndDragNDropPayload & {
files: FileData[];
}
ChangeSelection:FileAction
Variable

Action that is dispatched when the selection changes for any reason.

type ChangeSelectionPayload = {
selection: Set<string>;
}
OpenFiles:FileAction
Variable

Action that is dispatched when user wants to open some files. This action is often triggered by other actions.

type OpenFilesPayload = {
files: FileData[];
targetFile: FileData;
}
OpenParentFolder:FileAction
Variable

Action that is triggered when user wants to go up a directory.

OpenFileContextMenu:FileAction
Variable

Action that is dispatched when user opens the context menu, either by right click on something or using the context menu button on their keyboard.

type OpenFileContextMenuPayload = {
clientX: number;
clientY: number;
triggerFileId: Nullable<string>;
}

DefaultActions Object literal

Source code on GitHub: src/action-definitions/default.ts

OpenSelection:FileAction
Variable

Action that can be used to open currently selected files.

SelectAllFiles:FileAction
Variable

Action that selects all files.

ClearSelection:FileAction
Variable

Action that clear the file selection.

EnableListView:FileAction
Variable

Action that enables List view.

EnableCompactView:FileAction
Variable

Action that enables Compact view. Note that compact view is still experimental and should not be used in production.

EnableGridView:FileAction
Variable

Action that enables Grid view.

SortFilesByName:FileAction
Variable

Action that sorts files by file.name.

SortFilesBySize:FileAction
Variable

Action that sorts files by file.size.

SortFilesByDate:FileAction
Variable

Action that sorts files by file.modDate.

ToggleHiddenFiles:FileAction
Variable

Action that toggles whether hidden files are shown to the user or not.

ToggleShowFoldersFirst:FileAction
Variable

Action that toggles whether folders should appear before files regardless of current sort function.

FocusSearchInput:FileAction
Variable

Action that focuses the search input when it is dispatched.

ToggleDarkMode:FileAction
Variable

Action that enables List view.

ExtraActions Object literal

Source code on GitHub: src/action-definitions/extra.ts

CopyFiles:FileAction
Variable

Action that adds a button and shortcut to copy files.

CreateFolder:FileAction
Variable

Action that adds a button to create a new folder.

UploadFiles:FileAction
Variable

Action that adds a button to upload files.

DownloadFiles:FileAction
Variable

Action that adds a button to download files.

DeleteFiles:FileAction
Variable

Action that adds a button and shortcut to delete files.

If you have a question, want to request a feature or report a bug, please create an issue on GitHub. You can also report inaccurate or unclear documentation on Chonky's Discord server.