Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionFunc ¶
type OptionFunc func(t *Title)
OptionFunc definition
func WithAlignCenter ¶
func WithAlignCenter() OptionFunc
WithAlignCenter setting the title align to center
func WithAlignRight ¶
func WithAlignRight() OptionFunc
WithAlignRight setting the title align to right
func WithBorderBoth ¶
func WithBorderBoth() OptionFunc
WithBorderBoth setting the title border to both top and bottom
func WithBorderBottom ¶
func WithBorderBottom() OptionFunc
WithBorderBottom setting the title border to bottom
func WithBorderTop ¶
func WithBorderTop() OptionFunc
WithBorderTop setting the title border to top
Example ¶
ExampleBorderTop 演示顶部边框
package main
import (
"github.com/gookit/gcli/v3/show/title"
)
func main() {
title.New("Top Border Title", title.WithBorderTop()).Println()
// 演示底部边框(默认)
title.New("Bottom Border Title", title.WithBorderBottom()).Println()
// 演示上下边框
title.New("Top and Bottom Border Title", title.WithBorderBoth()).Println()
// ExampleNoBorder 演示无边框
title.New("No Border Title", title.WithoutBorder()).Println()
}
type Options ¶
type Options struct {
// Color 颜色Tag
Color string
// PaddingLR 是否左右填充 PaddingChar
PaddingLR bool
// PaddingChar 左右填充字符
PaddingChar rune
// 是否显示上下边框
ShowBorder bool
BorderChar rune
// BorderPos 边框位置 0: 无, 1: 上, 2: 下, 4: 上下
BorderPos gclicom.BorderPos
// 总的显示宽度
Width int
Indent int
Align comdef.Align
}
Options title options
type Title ¶
Title 在终端中打印标题行
func (*Title) WithOptionFns ¶
func (t *Title) WithOptionFns(fns []OptionFunc) *Title
WithOptionFns 设置选项
Click to show internal directories.
Click to hide internal directories.