Skip to content

Commit

Permalink
docs(README): updated
Browse files Browse the repository at this point in the history
  • Loading branch information
indaco committed Feb 27, 2023
1 parent 788f781 commit 61f71e9
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ Lightweight and customizable interactive prompt components for Go based CLI.

**prompti** is a collection of TUI blocks initially created to be used by [sveltin](https://github.com/sveltinio/sveltin) and its use cases. We worked on it to allow customizations and make it available as standalone package. Here it is!

## Input
## Install

Install the latest version by using the `go get` command. Ensure to have **(Go v1.18 or higher)** installed on your machine.

```bash
go get github.com/sveltinio/prompti@latest
```

## Prompts

### Input

`input` is a terminal input prompt component supporting default values, validations (`type ValidateFunc func(string) error`), password input echo and _customizable_ styles.

Expand All @@ -33,7 +43,7 @@ It also provides ready to use validation functions for some common use cases:
- email address
- url

### Default
#### Default

[Source Code](_examples/input/default/main.go)

Expand All @@ -43,76 +53,76 @@ It also provides ready to use validation functions for some common use cases:

<img src="https://statics.sveltin.io/github/prompti/input/input-initial-value.gif" alt="Input example with default value and validation">

### Custom styles
#### Custom styles

[Source Code](_examples/input/custom-styles/main.go)

<img src="https://statics.sveltin.io/github/prompti/input/input-styled.gif" alt="Input example with custom styles">

### Other Examples
#### Other Examples

- [Email](_examples/input/email/main.go)
- [Password](_examples/input/password/main.go)

## Choose
### Choose

`choose` is a customizable component for browsing a set of items.

### Default
#### Default

[Source Code](_examples/choose/default/main.go)

<img src="https://statics.sveltin.io/github/prompti/choose/choose-default.gif" alt="Choose example">

### Custom styles
#### Custom styles

[Source Code](_examples/choose/custom-styles/main.go)

<img src="https://statics.sveltin.io/github/prompti/choose/choose-styled.gif" alt="Choose example with custom styles">

## Confirm
### Confirm

`confirm` is a customizable component to confirm an anction.

### Default
#### Default

[Source Code](_examples/confirm/default/main.go)

<img src="https://statics.sveltin.io/github/prompti/confirm/confirm-default.gif" alt="Confirm example">

### Custom styles
#### Custom styles

[Source Code](_examples/confirm/custom-styles/main.go)

<img src="https://statics.sveltin.io/github/prompti/confirm/confirm-styled.gif" alt="Confirm example with custom styles">

## Toggle
### Toggle

`toggle` is a customizable component to confirm an anction. It works like `confirm` but it renders the options inline and not in a box.

### Default
#### Default

[Source Code](_examples/toggle/default/main.go)

<img src="https://statics.sveltin.io/github/prompti/toggle/toggle-default.gif" alt="Toggle example">

### Custom styles
#### Custom styles

[Source Code](_examples/toggle/custom-styles/main.go)

<img src="https://statics.sveltin.io/github/prompti/toggle/toggle-styled.gif" alt="Toggle example with custom styles">

## ProgressBar
### ProgressBar

`progressbar` is a customizable component for progress meter.

### Default
#### Default

[Source Code](_examples/progressbar/default/main.go)

<img src="https://statics.sveltin.io/github/prompti/progressbar/progressbar-default.gif" alt="ProgressBar example">

### Styled
#### Styled

[Source Code](_examples/progressbar/custom-styles/main.go)

Expand Down

0 comments on commit 61f71e9

Please sign in to comment.