-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
somewhat related to #77
I'd like to show previews of items when using select. for example:
import { select } from '@inquirer/prompts';
const items: { [name: string]: string } = {
foo: `This is a foo item.`
bar: `This is
a
multiline
bar item.
`,
}
const selection = await select({
message: `Please select an item`,
choices: Object.keys(items),
getPreview(item) {
assert(item in items);
return items[item];
},
});Might render as:
? Please select an item
foo | This is
❯ bar | a
| multiline
| bar item.
I'm not sure how the spacing would work out, but i'm sure theming can be used to influence how the preview is shown
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels