Utility
Terminal
Path input requires Node.js filesystem access and may not render in the browser preview.
Installation
$ pnpm dlx shadcn@latest add @termcn/ink/path-input
Usage
import { PathInput } from "@/components/ui/path-input";<PathInput
label="Project Directory"
placeholder="/home/user/projects"
onSubmit={(path) => console.log("Selected:", path)}
/>API Reference
PathInput
| Prop | Type | Default |
|---|---|---|
value | string | - |
onChange | (value: string) => void | - |
onSubmit | (value: string) => void | - |
label | string | - |
placeholder | string | "/" |
autoFocus | boolean | false |
id | string | - |
width | number | 40 |
filter | string | - |
dirsOnly | boolean | false |
Notes
Accessibility
termcn exposes the following behavior through Ink's terminal accessibility APIs. This is not a browser ARIA or general WCAG-conformance claim.
- Keyboard:
Left/Rightmove by grapheme,Home/Endmove to the boundaries, andBackspace/Deleteremove one complete grapheme.Entersubmits or confirms (Ctrl+Enterin TextArea);Tab/Shift+Tableave through Ink focus traversal. - Focus and composition: Input is active only while the component's focus target is focused, enabled, active, and inside the topmost focus scope.
- Screen reader: Ink labels and semantic state expose the component without relying on visual styling alone.