Skip to content

FilePicker

uitemplate

FilePicker: an interactive file browser widget

Installation

$ bunx termuijs add file-picker

Copies the source into src/components/file-picker/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { FilePicker } from '@termuijs/ui'
ts
new FilePicker(options: FilePickerOptions = {})

API Reference

FilePicker

PropTypeRequiredDescription
startPathstringoptionalInitial directory
filterstring[]optionalExtension filter (e.g
showHiddenbooleanoptionalShow dot-files / dot-directories
dirColorStyle['fg']optionalForeground colour for directory entries
fileColorStyle['fg']optionalForeground colour for file entries
activeColorStyle['fg']optionalForeground colour for the highlighted (active) row
onSelect(path: string) => voidoptionalCalled with the absolute path when the user selects a file
onCancel() => voidoptionalCalled when the user presses Escape
#template#file-picker