Skip to content

Conversation

@43081j
Copy link
Collaborator

@43081j 43081j commented Aug 3, 2025

Adds a new box prompt which works like so:

prompts.box(
  'This is a message',
  'This is a title',
  {
    rounded: true
  }
);

For reviewers

Feedback i'd like on this:

  • Does includePrefix make sense? Basically its to tell the box to output the usual | bar before it, so if it is part of a group of prompts it will fit in. If you set it to false (the default), it won't output this
  • This is very similar to the note prompt. It may be argued that we should just add the functionality to that instead of having a separate prompt

@changeset-bot
Copy link

changeset-bot bot commented Aug 3, 2025

🦋 Changeset detected

Latest commit: f2936c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clack/prompts Minor

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 3, 2025

@example/basic@example/changesets

npm i https://pkg.pr.new/bombshell-dev/clack/@clack/core@363
npm i https://pkg.pr.new/bombshell-dev/clack/@clack/prompts@363

commit: 858361c

@43081j 43081j requested a review from dreyfus92 August 3, 2025 21:25
Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is so cool, but wouldn't it be cooler if you could add a color prop to modify the color border of the box? or even the title?

thank you for adding tests btw, LGTM 🤘🏻

@43081j
Copy link
Collaborator Author

43081j commented Aug 4, 2025

i think you're right but i want to avoid some kind of borderColor setting

maybe we should do what note does and provide a format option, and a formatBorder option or some such thing

basically so you bring your own formatting, like formatBorder: (symbol) => styleText('blue', symbol)

@43081j
Copy link
Collaborator Author

43081j commented Aug 9, 2025

i've added a formatBorder option, so you can do this:

box('some message', 'some title', {
  formatBorder: styleText.bind(null, 'red'), // or picocolors.red
});

Copy link
Member

@dreyfus92 dreyfus92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's ship it 🤘🏻

@43081j 43081j merged commit 76fd17f into main Aug 10, 2025
7 checks passed
@43081j 43081j deleted the box-prompt branch August 10, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants