The 'GML-UI' package is a Go library that offers a set of components for developing Text-based User Interfaces (TUI). 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.
go get https://github.com/anotherhadi/gml-ui@latest
Almost all components accept the Settings struct (from gml-ui/settings) 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.
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 add a Filter to allow the user to filter the options.
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
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
The confirm
component allows you to quickly prompt the user to choose between Yes/No, True/False, etc..
Move with the arrow keys or HL, select an option with CR
The confirm_inline
component allows you to quickly prompt the user to choose between Yes/No, True/False, etc.. But inline.
The input
component allows you to prompt the user to type a string
The number_picker
component allows you to quickly prompt the user to choose a number (int or float).
Increment/Decrement with the arrow keys or HJ/KL, type a number to change the input, and validate with CR.
You can change the Maximum and Minimum through Settings.
The paragraph
component is used to print strings with the same look and feel as other components.
The asciitext
component is used to print large ASCII art text.
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.
A collection of emojis made from ASCII characters. From asciimoji
The loading
component is a loading spinner, useful for indicating that some kind of operation is in progress.
The progress
component is a progress bar, helpful for visualizing the advancement of a task or process.
The table
component is ideal for creating tables with columns and other features for organized data representation.
The getchar
package enables you to capture a single character or key input without the need for the user to press enter.
Example:
ascii, arrow, err := getchar.GetChar()
if err != nil {
panic(err)
}
fmt.Print(ascii, arrow)
The getsize
package allows you to obtain the size in columns and rows of the terminal.
Example:
cols, rows, err := getsize.GetSize()
if err != nil {
panic(err)
}
fmt.Print(cols, rows)