简体中文
Variable: autocompleteMultiselect
ts
const autocompleteMultiselect: <Value>(
opts,
) => Promise<Value[] | typeof CANCEL_SYMBOL>;Defined in: node_modules/.pnpm/@clack+prompts@1.9.0/node_modules/@clack/prompts/dist/index.d.mts:224
The autocompleteMultiselect prompt combines the search functionality of autocomplete with the ability to select multiple options.
Type Parameters
| Type Parameter |
|---|
Parameters
| Parameter | Type |
|---|---|
|
Returns
Promise<Value[] | typeof CANCEL_SYMBOL>
See
https://bomb.sh/docs/clack/packages/prompts/#autocomplete-multiselect
Example
ts
import { autocompleteMultiselect } from "@clack/prompts";
const frameworks = await autocompleteMultiselect({
message: "Select frameworks",
options: [
{ value: "next", label: "Next.js", hint: "React framework" },
{ value: "astro", label: "Astro", hint: "Content-focused" },
{ value: "svelte", label: "SvelteKit", hint: "Compile-time framework" },
{ value: "remix", label: "Remix", hint: "Full stack framework" },
{ value: "nuxt", label: "Nuxt", hint: "Vue framework" },
],
placeholder: "Type to search...",
maxItems: 5,
});
