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
| source |`(term: string \| void) => Promise<Choice[]>`| yes | This function returns the choices relevant to the search term. |
93
-
| pageSize |`number`| no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |
94
-
| validate |`Value => boolean \| string \| Promise<boolean \| string>`| no | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
95
-
| theme |[See Theming](#Theming)| no | Customize look of the prompt. |
| source |`(term: string \| void) => Promise<Choice[]>`| yes | This function returns the choices relevant to the search term. |
93
+
| pageSize |`number`| no | By default, lists of choice longer than 7 will be paginated. Use this option to control how many choices will appear on the screen at once. |
94
+
| validate |`Value => boolean \| string \| Promise<boolean \| string>`| no | On submit, validate the answer. When returning a string, it'll be used as the error message displayed to the user. Note: returning a rejected promise, we'll assume a code error happened and crash. |
95
+
| instructions |`{ navigation: string; pager: string }`| no | Customize the help instructions shown at the bottom of the prompt. |
96
+
| theme |[See Theming](#Theming)| no | Customize look of the prompt. |
96
97
97
98
### `source` function
98
99
@@ -136,6 +137,13 @@ Here's each property:
136
137
137
138
Choices can also be an array of string, in which case the string will be used both as the `value` and the `name`.
138
139
140
+
### `instructions` object
141
+
142
+
The `instructions` option allows you to customize the help text displayed at the bottom of the prompt:
143
+
144
+
-`navigation`: The instruction text shown when all choices fit within the page size (default: "Use arrow keys")
145
+
-`pager`: The instruction text shown when there are more choices than the page size (default: "Use arrow keys to reveal more choices")
146
+
139
147
### Validation & autocomplete interaction
140
148
141
149
The validation within the search prompt acts as a signal for the autocomplete feature.
0 commit comments