Code Monkey home page Code Monkey logo

Comments (12)

aral avatar aral commented on May 17, 2024 2

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.

lukeed avatar lukeed commented on May 17, 2024 1

I think that the furthest I'd take this is allowing a specific prefix per prompt.

from prompts.

terkelg avatar terkelg commented on May 17, 2024 1

This is on hold for now – I'll look into this for a v2

from prompts.

terkelg avatar terkelg commented on May 17, 2024

Do you want it to be dynamic, so it can change during runtime?

from prompts.

terkelg avatar terkelg commented on May 17, 2024

@lukeed per prompt object or prompt function? I guess we can make it a option

from prompts.

lukeed avatar lukeed commented on May 17, 2024

I don't need this, but I would guess those who want it would want per object.

from prompts.

tunnckoCore avatar tunnckoCore commented on May 17, 2024

Per object, yea. Which in turn to be able to be function too. Don't need too but sounds good thing.

from prompts.

terkelg avatar terkelg commented on May 17, 2024

Perfect! This will be implemented.

from prompts.

terkelg avatar terkelg commented on May 17, 2024

opt.symbols could look like this:

{
  prompt: { done, aborted, default },
  delimiter: { default },
  item: { expanded, default }
}

Is this too much?

from prompts.

terkelg avatar terkelg commented on May 17, 2024

Closing for now

from prompts.

lauriejim avatar lauriejim commented on May 17, 2024

@terkelg opt.symbols is a good option.

from prompts.

jzecca avatar jzecca commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.