Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] text: Add 'help' key to provide prompt description to the user #135

Open
moniuch opened this issue Aug 8, 2023 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@moniuch
Copy link

moniuch commented Aug 8, 2023

Could you suggest the best way to provide a legend/help text under the main prompt? Could be that it already exists, but I wasn't able to find it. I tried with a new line within message, which probably would work for small things:

name: () => text({message: 'What is your name?\nDon\'t lie!'}),

but is not really a good solution for a couple of reasons.

image

I tried the placeholder option, but it is definitely meant for editable inputs, and not for what I'm after

image

Would be best to have a hassle-free way of:

  • aligning the hint with the main prompt
  • wrapped text should also stay aligned with the main prompt
  • dimmed style by default

The placeholder key is half-way there, I'd say - first line nicely aligned, dimmed out text.

image

It could be under a new key in the options object (help):

name: () => text({
  message: 'What is your name?',
  help: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Atque eaque error eum ex, fugiat harum labore laboriosam libero magnam maiores modi natus optio quae quod recusandae repellendus sapiente vero voluptatum.'
}),

Motivation: in extensive flows for which the package might be used, explaining the step and the consequences of user decision, is essential, so that's why it was my first thing I tested here.

@moniuch moniuch added the enhancement New feature or request label Aug 8, 2023
@cpreston321
Copy link
Collaborator

Issue relates to: #111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs triage
Development

No branches or pull requests

2 participants