Skip to content

Add footer option to select-like prompts #551

@aqeelat

Description

@aqeelat

Context

This came up while evaluating @clack/prompts as a potential replacement for enquirer.js, comparing it with enquirer.js and @inquirer/prompts.

Split out from: #550

Problem

There is no way to render instructional text below the options list.

For example:

Choose packages to update

◻ package-a
◻ package-b
◻ package-c

Enter to start updating. Ctrl-c to cancel.

The current workaround is to include this text in the prompt message, but that places the instructions above the list rather than below it.

Proposal

Add a footer option to select-like prompts, initially select, multiselect, groupMultiselect, and possibly autocomplete:

const selected = await multiselect({
  message: 'Choose packages to update',
  footer: 'Enter to start updating. Ctrl-c to cancel.',
  options: [...],
})

The footer should render below the options list and update consistently as the prompt re-renders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions