Documentation
¶
Overview ¶
Package box renders framed boxes around arbitrary text: rounded, hard, double, and ascii corners, an optional title in the top border, padding, and width fitting or wrapping. Content may carry ANSI styling; borders measure visible glyphs so alignment holds.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Style picks the frame glyphs; zero is StyleRounded.
Style Style
// Title renders in the top border, e.g. ╭─ Warning ─╮, and is
// truncated with an ellipsis when the box is too narrow.
Title string
// Padding is the inner horizontal spaces between frame and
// content; negative values clamp to zero.
Padding int
// Width is the total outer width including the frame. Zero fits
// the content; a positive value wraps content to fit, clamping to
// one content column when smaller than the frame. StyleNone
// measures Width against the content alone.
Width int
// Frame colors the frame glyphs. Zero (the engine's Reset
// attribute) leaves the frame plain.
Frame style.Attribute
}
Options tunes a box. The zero value renders a rounded frame sized to the content with no padding.