bombshell-dev / clack

Effortlessly build beautiful command-line apps
https://clack.cc
5.53k stars 90 forks source link

feat(@clack/prompts): add `maxItems` option to select prompt #129

Closed lforst closed 1 year ago

lforst commented 1 year ago

This PR adds a maxItems option to @clack/prompts's select prompt that allows to limit the number of shown options at any given time.

When using this option, any list of options that exceeds maxItems will instead show a scrollable list. The "scrollability" is denoted by ellipses ("...").

I am not opinionated about the name maxItems for the option. We could also name it maxItemsShown or something similar.

Ref https://github.com/getsentry/sentry-wizard/issues/286 Resolves https://github.com/natemoo-re/clack/issues/118


Example:

https://github.com/natemoo-re/clack/assets/8118419/72577604-ac18-4538-ba71-0fd19159f50b

changeset-bot[bot] commented 1 year ago

⚠️ No Changeset found

Latest commit: be76cb27c7ca26dd083f20b1bdca303449d8f948

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

peterroe commented 1 year ago

I need this feature urgently!!!