You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you set `placeholder` and the search field is **empty**, pressing **Tab** copies the placeholder string into the input (v1.2.0)—handy for default search tokens or quick acceptance of a suggested value.
346
+
Options:
347
+
348
+
-`message`: The prompt message or question shown to the user above the input.
349
+
-`options`: The options to present, or a function that returns the options to present allowing for custom search/filtering. [Learn more below](#dynamic-options-getter).
350
+
-`maxItems`: The maximum number of items/options to display in the autocomplete list at once.
351
+
-`placeholder`: Placeholder text displayed when the search field is empty. When set, pressing tab copies the placeholder into the input.
352
+
-`validate`: A function that validates user input. Return a `string` or `Error` to show as a validation error, or `undefined` to accept the result.
353
+
-`filter`: Custom filter function to match options against the search input.
354
+
-`initialValue`: The initially selected option from the list.
355
+
-`initialUserInput`: The starting value shown in the users input box.
-`message`: The prompt message or question shown to the user above the input.
437
+
-`options`: The options to present, or a function that returns the options to present allowing for custom search/filtering. [Learn more below](#dynamic-options-getter).
438
+
-`maxItems`: The maximum number of items/options to display in the autocomplete list at once.
439
+
-`placeholder`: Placeholder text displayed when the search field is empty. When set, pressing tab copies the placeholder into the input.
440
+
-`validate`: A function that validates user input. Return a `string` or `Error` to show as a validation error, or `undefined` to accept the result.
441
+
-`filter`: Custom filter function to match options against the search input.
442
+
-`initialValue`: The initially selected option(s) from the list.
443
+
-`required`: When `true`, at least one option must be selected (default: `false`).
444
+
- All [Common Options](#common-options)
445
+
424
446
### Path Selection
425
447
426
-
The `path` prompt provides an autocomplete-based file and directory path selection. It automatically suggests files and directories as the user types.
448
+
The `path` prompt extends [`autocomplete`](#autocomplete) to provide file and directory suggestions.
-`root`: The starting directory for path suggestions (defaults to current working directory)
450
-
-`directory`: When `true`, only **directories** appear in suggestions while you navigate; you still move through the tree normally (v1.2.0 fixes for directory-only mode).
451
-
-`initialValue`: Pre-fill the path input. In **directory** mode, if `initialValue` already points at an existing directory, pressing **Enter** submits **that** directory immediately instead of jumping to the first child (v1.2.0).
452
-
-`validate`: Custom validation function for the selected path
470
+
-`message`: The prompt message or question shown to the user above the input.
471
+
-`root`: The starting directory for path suggestions (defaults to current working directory).
472
+
-`directory`: When `true`, only **directories** appear in suggestions while you navigate (v1.2.0 fixes for directory-only mode).
473
+
-`initialValue`: The starting path shown when the prompt first renders, which users can edit before submitting. If not provided it will fall back to the given `root`, or the current working directory. In `directory` mode, if the initial value points to a directory that exists, pressing enter will submit the input instead of jumping to the first child (v1.2.0).
474
+
-`validate`: A function that validates the given path. Return a `string` or `Error` to show as a validation error, or `undefined` to accept the result.
0 commit comments