Documentation
¶
Index ¶
- Variables
- func BorderOptionBGColor(color uint8) func(*View)
- func BorderOptionFGColor(color uint8) func(*View)
- func If[T any](condition bool, t T, f T) T
- func Map[T1 any, T2 any](slice []T1, fn func(T1) T2) []T2
- func MapN[T any](number int, fn func(int) T) []T
- func OptionChannel(ch chan any) func(*config) error
- func OptionEventHandler(fn func(any) any) func(*config) error
- func Run(createView func() *View, options ...option) error
- func RuneWidth(r rune) int
- func TermSize() (width int, height int, err error)
- func UseRef[T any](initialState T) *T
- func UseState[T any](initialState T) (T, func(T))
- type Benchmarker
- type View
- func Break() *View
- func Cursor(s string) *View
- func Fmt(format string, a ...any) *View
- func HMap[T any](slice []T, fn func(T) *View) *View
- func HStack(views ...*View) *View
- func InlineMap[T any](slice []T, fn func(T) *View) *View
- func InlineMapN(number int, fn func(int) *View) *View
- func InlineStack(views ...*View) *View
- func List(selected *int, views ...*View) *View
- func ListMap[T any](selected *int, slice []T, fn func(T) *View) *View
- func ListMapN(selected *int, number int, fn func(int) *View) *View
- func ScrollView(views ...*View) *View
- func Spacer() *View
- func String(s string) *View
- func TextView(body string) *View
- func VMap[T any](slice []T, fn func(T) *View) *View
- func VMapN(number int, fn func(int) *View) *View
- func VStack(views ...*View) *View
- func ZMap[T any](slice []T, fn func(T) *View) *View
- func ZStack(views ...*View) *View
- func (v *View) AbsoluteSize(width, height int) *View
- func (v *View) AllowOverflow() *View
- func (v *View) BGColor(color uint8) *View
- func (v *View) Bold() *View
- func (v *View) Border(options ...borderOption) *View
- func (v *View) FGColor(color uint8) *View
- func (v *View) Hidden(isHidden bool) *View
- func (v *View) If(condition bool, fn func(v *View) *View) *View
- func (v *View) Italic() *View
- func (v *View) KeyHandler(fn func(rune) any) *View
- func (v *View) OffsetY(i int) *View
- func (v *View) Padding(values ...uint8) *View
- func (v *View) Priority(priority int8) *View
- func (v *View) RelativeSize(width, height uint8) *View
- func (v *View) Reverse() *View
- func (v *View) Strikethrough() *View
- func (v *View) Title(title string) *View
- func (v *View) Underline() *View
Constants ¶
This section is empty.
Variables ¶
var Terminate = terminate{}
Functions ¶
func BorderOptionBGColor ¶ added in v0.0.5
func BorderOptionFGColor ¶ added in v0.0.5
func OptionChannel ¶ added in v0.0.2
func OptionEventHandler ¶ added in v0.0.2
Types ¶
type Benchmarker ¶ added in v0.0.7
type Benchmarker struct {
// contains filtered or unexported fields
}
type View ¶
type View struct {
// contains filtered or unexported fields
}
func InlineStack ¶ added in v0.0.5
func ScrollView ¶ added in v0.0.7
func (*View) AbsoluteSize ¶ added in v0.0.2
AbsoluteSize specifies absolute width and height of units that the view used. 0 means auto-resizing.
func (*View) AllowOverflow ¶ added in v0.0.7
func (*View) Padding ¶ added in v0.0.2
Padding sets padding values to the view. When one value is specified, it applies the same padding to all four sides. When two values are specified, the first padding applies to the top and bottom, the second to the left and right. When three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom. When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise).
func (*View) RelativeSize ¶ added in v0.0.2
RelativeSize specifies relative width and height of units that the view used. The maximum number allowed is 12(100% of the parent view), and 0 means auto-resizing.
func (*View) Strikethrough ¶ added in v0.0.6
Strikethrough sets strikethourgh style to the view.