Comments (12)
I just added very quick and dirty custom symbol support for the confirmation prompt in my branch: https://github.com/aral/prompts/tree/custom-symbols-for-confirm
To use:
{
type: 'confirm',
name: 'confirmed',
message: 'Can you confirm?',
symbol: () => (done, aborted) => aborted ? '❌' : done ? '🎉' : '🧐',
}
In case it helps as a stopgap for anyone else.
from prompts.
I think that the furthest I'd take this is allowing a specific prefix
per prompt.
from prompts.
This is on hold for now – I'll look into this for a v2
from prompts.
Do you want it to be dynamic, so it can change during runtime?
from prompts.
@lukeed per prompt object or prompt function? I guess we can make it a option
from prompts.
I don't need this, but I would guess those who want it would want per object.
from prompts.
Per object, yea. Which in turn to be able to be function too. Don't need too but sounds good thing.
from prompts.
Perfect! This will be implemented.
from prompts.
opt.symbols
could look like this:
{
prompt: { done, aborted, default },
delimiter: { default },
item: { expanded, default }
}
Is this too much?
from prompts.
Closing for now
from prompts.
@terkelg opt.symbols
is a good option.
from prompts.
Has this idea been abandonned?
Being able to customize the output would be a really nice addition without adding much complexity.
from prompts.
Related Issues (20)
- Ensure types are exported HOT 3
- How to cancel these unnecessary logs HOT 5
- logic diagram
- Ast prompts
- Roadmap for a 3.0 HOT 5
- prompts captures Ctrl-W "cut word" shortcut as control character
- How to make autocomplete required or select searchable?
- Add mask option to Text Type
- Somewhat different published module than the one in the repo HOT 2
- Keypress events may not be triggered on Windows if validate callback contains async actions HOT 2
- Bun support HOT 11
- confirm element: pressing a function key throws an error
- correctly type return/resolved values instead of `any`
- Initial value not passed to validate function for `"number"` types
- When the type is multiSelect, options cannot be switched through the arrows on the keyboard HOT 1
- Better index selection when providing initial for autocomplete
- Ability to prefill input on autocomplete HOT 1
- Can't seem to create a prompt with a Discord ID
- autocompleteMultiselect errors on invalid option
- Content "scrolls up" when typing a new value after validation fails
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prompts.