Utility
Terminal
█
file-picker-demo █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█File picker requires Node.js filesystem access and may not render in the browser preview.
Installation
$ pnpm dlx shadcn@latest add @termcn/opentui/file-picker
Usage
import { FilePicker } from "@/components/ui/file-picker";<FilePicker
label="Select a config file"
extensions={[".json", ".yaml", ".yml"]}
onSubmit={(path) => console.log("Selected:", path)}
/>API Reference
FilePicker
| Prop | Type | Default |
|---|---|---|
value | string | - |
onChange | (path: string) => void | - |
onSubmit | (path: string) => void | - |
label | string | - |
startDir | string | process.cwd() |
extensions | string[] | - |
dirsOnly | boolean | false |
autoFocus | boolean | false |
id | string | - |
width | number | 50 |
maxVisible | number | 8 |