teatile

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

teatile

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinHorizontal

func JoinHorizontal(tiles ...*Tile)

JoinHorizontal joins the specified tiles horizontally.

func JoinVertical

func JoinVertical(tiles ...*Tile)

JoinVertical joins the specified tiles vertically.

Types

type Tile

type Tile struct {
	// contains filtered or unexported fields
}

func New

func New() *Tile

New creates a new Tile.

func (*Tile) GetSize

func (t *Tile) GetSize() (int, int)

GetSize returns the width and height of the tile and calculates them if necessary.

func (*Tile) GetSubtile

func (t *Tile) GetSubtile(name string) *Tile

GetSubtile returns the subtile by name.

func (*Tile) NewNamedSubtile

func (t *Tile) NewNamedSubtile(name string) *Tile

NewNamedSubtile creates a new subtile with a name that can be used to refer to it later.

func (*Tile) NewStyle

func (t *Tile) NewStyle() lipgloss.Style

NewStyle creates a new style and calls SetStyle on it.

func (*Tile) NewSubtile

func (t *Tile) NewSubtile() *Tile

NewSubtile creates a new subtile with a random unique name, use this if there's no need to refer to the tile later.

func (*Tile) OnRecalculate

func (t *Tile) OnRecalculate(cb func())

OnRecalculate adds the specified callback function to the list of funcs that will be called on recalculation of the tile's size.

func (*Tile) Recalculate

func (t *Tile) Recalculate()

Recalculate forces a recalculation of the tile's size and calls OnRecalculate callbacks. This effect is recursively propagated to all subtiles as well.

func (*Tile) SetStyle

func (t *Tile) SetStyle(s lipgloss.Style) lipgloss.Style

SetStyle sets the width and height of a style according to the tile.

func (*Tile) WithSize

func (t *Tile) WithSize(w, h int) *Tile

WithSize sets the width and height of the tile.

Jump to

Keyboard shortcuts

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