Utility
AI
Terminal
File picker requires Node.js filesystem access and may not render in the browser preview.
Installation
pnpm dlx shadcn@latest add https://termcn.dev/r/file-picker.json
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 | undefined |
onChange | (path: string) => void | undefined |
onSubmit | (path: string) => void | undefined |
label | string | undefined |
startDir | string | process.cwd() |
extensions | string[] | undefined |
dirsOnly | boolean | false |
autoFocus | boolean | false |
id | string | undefined |
width | number | 50 |
maxVisible | number | 8 |