Skip to content

Latest commit

 

History

History
72 lines (57 loc) · 6.26 KB

box.md

File metadata and controls

72 lines (57 loc) · 6.26 KB

BoxPrinter

BoxPrinter Example

(Show source of demo)

Usage

Basic usage

pterm.DefaultBox.Println("test")

Options

To make a copy with modified options you can use: pterm.DefaultBox.WithOptionName(option)

To change multiple options at once, you can chain the functions: pterm.DefaultBox.WithOptionName(option).WithOptionName2(option2)...

Tip

Click the options and types to show the documentation on pkg.go.dev

Option Type
BottomLeftCornerString string
BottomPadding int
BottomRightCornerString string
BoxStyle *Style
HorizontalString string
LeftPadding int
RightPadding int
Text string
TextStyle *Style
Title string
TitleBottomCenter boolean
TitleBottomLeft boolean
TitleBottomRight boolean
TitleTopCenter boolean
TitleTopLeft boolean
TitleTopRight boolean
TopLeftCornerString string
TopPadding int
TopRightCornerString string
VerticalString string
Writer io.Writer

Output functions

This printer implements the interface TextPrinter

Function Description
Sprint(a ...interface{}) Returns a string
Sprintln(a ...interface{}) Returns a string with a new line at the end
Sprintf(format string, a ...interface{}) Returns a string, formatted according to a format specifier
Sprintfln(format string, a ...interface{}) Returns a string, formatted according to a format specifier with a new line at the end
Print(a ...interface{}) Prints to the terminal
Println(a ...interface{}) Prints to the terminal with a new line at the end
Printf(format string, a ...interface{}) Prints to the terminal, formatted according to a format specifier
Printfln(format string, a ...interface{}) Prints to the terminal, formatted according to a format specifier with a new line at the end

Related