package spin

  1. Overview
  2. Docs

Module to customize Inquire prompts.

type color =
  1. | Black
  2. | Red
  3. | Green
  4. | Yellow
  5. | Blue
  6. | Magenta
  7. | Cyan
  8. | White
  9. | Bright_black
  10. | Bright_red
  11. | Bright_green
  12. | Bright_yellow
  13. | Bright_blue
  14. | Bright_magenta
  15. | Bright_cyan
  16. | Bright_white
  17. | Default

Available colors.

type style =
  1. | Reset
  2. | Bold
  3. | Underlined
  4. | Inverse
  5. | Hidden
  6. | Foreground of color
  7. | Background of color

Various styles for the text. Blink and Hidden may not work on every terminal.

val black : style

Shortcut for Foreground Black

val red : style

Shortcut for Foreground Red

val green : style

Shortcut for Foreground Green

val yellow : style

Shortcut for Foreground Yellow

val blue : style

Shortcut for Foreground Blue

val magenta : style

Shortcut for Foreground Magenta

val cyan : style

Shortcut for Foreground Cyan

val white : style

Shortcut for Foreground White

val bg_black : style

Shortcut for Background Black

val bg_red : style

Shortcut for Background Red

val bg_green : style

Shortcut for Background Green

val bg_yellow : style

Shortcut for Background Yellow

val bg_blue : style

Shortcut for Background Blue

val bg_magenta : style

Shortcut for Background Magenta

val bg_cyan : style

Shortcut for Background Cyan

val bg_white : style

Shortcut for Background White

val bg_default : style

Shortcut for Background Default

val bold : style

Shortcut for Bold

val underlined : style

Shortcut for Underlined

Shortcut for Blink

val inverse : style

Shortcut for Inverse

val hidden : style

Shortcut for Hidden

type t
val default : t

The default style used by Inquire prompts if none is provided.

val make : ?qmark_icon:string -> ?qmark_format:Ansi.style list -> ?message_format:Ansi.style list -> ?error_icon:string -> ?error_format:Ansi.style list -> ?default_format:Ansi.style list -> ?option_icon_marked:string -> ?option_icon_unmarked:string -> ?pointer_icon:string -> unit -> t

Create a custom style.

  • qmark_icon is the icon used for the question mark that prefixes the prompt.
  • qmark_format is the format of the question mark.
  • message_format is the format of the prompt message.
  • error_icon is the icon used for error messages.
  • error_format is the format used for the error messages.
  • default_format is the format used for the default tooltip of the prompt, if present.
  • option_icon_marked is the icon used to mark selected options in multi-selection prompts.
  • option_icon_unmarked is the icon used to mark unselected options in multi-selection prompts.
  • pointer_icon is the icon used to mark the selected option in single-selection prompts.