Documentation
¶
Overview ¶
Package panel wraps arbitrary content in a bordered container with an optional title and footer. It's the workhorse layout primitive: almost every other component pairs well inside a Panel.
A Panel doesn't update or animate; it's a pure render wrapper. Set width to clamp the inner content area; height 0 means "natural height" (the content's line count).
Index ¶
- type Panel
- func (p Panel) View() string
- func (p Panel) WithContent(c string) Panel
- func (p Panel) WithFooter(footer string) Panel
- func (p Panel) WithHeight(h int) Panel
- func (p Panel) WithPadding(x, y int) Panel
- func (p Panel) WithTitle(title string) Panel
- func (p Panel) WithVariant(v Variant) Panel
- func (p Panel) WithWidth(w int) Panel
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Panel ¶
type Panel struct {
// contains filtered or unexported fields
}
Panel is a bordered container with optional title and footer.
func (Panel) WithContent ¶
func (Panel) WithFooter ¶
func (Panel) WithHeight ¶
WithHeight clamps the outer panel height (including borders). Values <= 0 mean natural height.
func (Panel) WithPadding ¶
WithPadding sets horizontal and vertical padding inside the borders.
func (Panel) WithVariant ¶
WithVariant selects the border weight.
Click to show internal directories.
Click to hide internal directories.
