box

package
v0.0.0-...-48f2f3c Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Box

func Box(c *app.Ctx, props app.Props) string

Box is the functional component for rendering a box with a viewport.

func New

func New(c *app.Ctx, child app.FC, opts ...BoxProp) *app.C

New creates a new Box component.

func NewEmpty

func NewEmpty(c *app.Ctx, opts ...BoxProp) *app.C

NewEmpty creates a new Box component with no children.

Types

type BoxProp

type BoxProp func(*BoxProps)

BoxProp is a function type for setting BoxProps.

func WithBg

func WithBg(bg color.Color) BoxProp

WithBg sets the background color for the box.

func WithBorder

func WithBorder(border lipgloss.Border) BoxProp

func WithBorderBottom

func WithBorderBottom(border lipgloss.Border) BoxProp

func WithBorderColor

func WithBorderColor(color color.Color) BoxProp

func WithBorderLeft

func WithBorderLeft(border lipgloss.Border) BoxProp

func WithBorderRight

func WithBorderRight(border lipgloss.Border) BoxProp

func WithBorderTop

func WithBorderTop(border lipgloss.Border) BoxProp

func WithDisableFollow

func WithDisableFollow(disable bool) BoxProp

WithDisableFollow disables the viewport's auto-scrolling to the bottom on content change.

func WithGrow

func WithGrow(grow bool) BoxProp

func WithGrowX

func WithGrowX(grow bool) BoxProp

func WithGrowY

func WithGrowY(grow bool) BoxProp

func WithHeight

func WithHeight(height int) BoxProp

func WithKey

func WithKey(key string) BoxProp

func WithWidth

func WithWidth(width int) BoxProp

type BoxProps

type BoxProps struct {
	Key           string
	Bg            color.Color
	DisableFollow bool
	Child         app.FC
	app.Layout
	app.Border
}

BoxProps defines the properties for the Box component.

Directories

Path Synopsis
Package viewport provides a component for rendering a viewport in a Bubble Tea.
Package viewport provides a component for rendering a viewport in a Bubble Tea.

Jump to

Keyboard shortcuts

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