Package Exports
- inquirer-select-with-banner
- inquirer-select-with-banner/package.json
Readme
inquirer-select-with-banner

An Inquirer.js select prompt that displays a dynamic banner above the choices, updating as the user navigates through options.
Inspired by inquirer-select-with-state, the core difference being that the banner function is given what the user is currently hovering on, allowing for context aware information to be shown.
Installation
npm install inquirer-select-with-bannerUsage
import { select } from 'inquirer-select-with-banner';
const answer = await select({
message: 'Choose your weapon',
choices: [
{ value: 'axe', name: 'Battle Axe' },
{ value: 'sword', name: 'Sword' },
{ value: 'bow', name: 'Bow and Arrow' }
],
banner: (choice) => `Selected: ${choice.name}` // <- Controls the banner. return `string` to display, `undefined` or '' to clear, `null` to preserve the previous banner
});banner
The return value of the banner function should be a string that controls what the banner displays.
If you want the banner to not update, you can pass null to have it reuse the previous selection's banner.