wtuicomponents

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 0 Imported by: 0

README

What's this UI? - Components

Latest Release GoDoc GoReportCard

The wtui-components package is a Go library that offers a set of components for developing Text-based User Interfaces (TUI) with wtui or in standalone mode. It includes features like input fields, selections, and other essential components for building interactive text-based applications. Easy to set up, use, customize and modify. Some components are inspired by charmbracelet/bubbles.

Contents

Installation

go get https://github.com/anotherhadi/wtui-components@latest

Components

Almost all components accept the wtopts.Opts struct (from wtui-components/wtops) which allows you to modify various parameters: Colors, Default values, Maximum and Minimum, Max rows & columns, etc. You can refer to the examples folder for each component to learn more about the component and/or opts.

ANSI

ANSI Example

The ansi package provides a simple and user-friendly way to add color and formatting to terminal output in Go applications. Enhance your command-line interfaces with vibrant text, background colors, and text styles, making your output more readable and visually appealing.

You can found an example here

Asciimoji

Asciimoji Example

The asciimoji package is a collection of emojis made from ASCII characters. From asciimoji.com

You can found an example here

Asciitext

Asciitext Example

The asciitext component is used to print large ASCII art text.

You can found an example with and without options here

Breadcrumb

Breadcrumb Example

The breadcrumb component allows you to display breadcrumbs through a list of strings.

You can found an example here

Checkbox

Checkbox Example

The checkbox component allows you to quicky prompt the user to choose multiple options. Move with the arrow keys or JK, select an option with SPACE.

You can found an example with and without options here

Combobox

Combobox Example

The combobox component allows you to quickly prompt the user to choose an option. Move with the arrow keys or JK, select an option with CR, and change the filter with other keys.

You can found an example with and without options here

Confirm

Confirm Example

The confirm component allows you to quickly prompt the user to choose between Yes/No, True/False, etc.. Move with the arrow keys or HJKL/YN, confirm selection with CR

You can found an example with and without options here

Floating Window

Floating Window Example

The floatingwindow component allow you to print boxes with different styles.

You can found an example with and without options here

Get Char

Get Char Example

The getchar package enables you to capture a single character or key input without the need for the user to press enter.

You can found an example here

Get Size

Get Size Example

The getsize package allows you to obtain the size in columns and rows of the terminal.

You can found an example here

Image

Image Example

The image component allows you to print some low quality image in the terminal

You can found an example here

Input

Input Example

The input component allows you to prompt the user to type a string.

You can found an example with and without options here

List

List Example

The list component allows you to quickly prompt the user to choose an option (With Title/Description). Move with the arrow keys or HL, select an option with CR.

You can found an example with and without options here

Notification

Notification Example

The notification component allows you to print some nice notifications. You can change the notification's status through the "status" parameter.

You can found an example with and without options here

Number Picker

Number Picker Example

The numberpicker component allows you to quickly prompt the user to choose a number. Increment/Decrement with the arrow keys or HJ/KL, type a number to change the input, and validate with CR. You can change 'Maximum, Minimum, Increment, Decimals' through Opts.

You can found an example with and without options here

Paragraph

Paragraph Example

The paragraph component is used to print strings with the same look and feel as other components. You can use the markdown syntax for bold and italic.

You can found an example with and without options here

RGBA Picker

RGBA Picker Example

The rgbapicker component allows you to quickly prompt the user to choose a rgba color (Red,Green,Blue,Opacity). Increment/Decrement/Move with the arrow keys or HJKL, type a number to change a field, and validate with CR.

You can found an example with and without options here

RGB Picker

RGB Picker Example

The rgbpicker component allows you to quickly prompt the user to choose a rgb color (Red,Green,Blue). Increment/Decrement/Move with the arrow keys or HJ/KL, type a number to change a field, and validate with CR.

You can found an example with and without options here

Selection

Selection Example

The selection component allows you to quickly prompt the user to choose an option. Move with the arrow keys or JK, select an option with CR.

You can found an example with and without options here

Shortcuts

Shortcuts Example

The shortcuts component allows you to print a list of shortcuts with the same look and feel as other components.

You can found an example here

Spacer

Spacer Example

The spacer component allows you to print space between components

You can found an example here

Table

Table Example

The table component is ideal for creating tables with columns and other features for organized data representation.

You can found an example with and without options here

Options

You can refer to the examples folder for each component to learn more about options (wtui-components/wtops).

License

This project is licensed under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL