FilePicker
uitemplate
FilePicker: an interactive file browser widget
Terminal
$termuijs render file-picker
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
| Prop | Type | Required | Description |
|---|---|---|---|
startPath | string | optional | Initial directory |
filter | string[] | optional | Extension filter (e.g |
showHidden | boolean | optional | Show dot-files / dot-directories |
dirColor | Style['fg'] | optional | Foreground colour for directory entries |
fileColor | Style['fg'] | optional | Foreground colour for file entries |
activeColor | Style['fg'] | optional | Foreground colour for the highlighted (active) row |
onSelect | (path: string) => void | optional | Called with the absolute path when the user selects a file |
onCancel | () => void | optional | Called when the user presses Escape |