Documentation
¶
Overview ¶
Package overlay provides terminal UI overlay functionality for placing foreground content on top of background content, similar to modal dialogs or popup windows in terminal applications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Overlay ¶
type Overlay struct {
// contains filtered or unexported fields
}
Overlay manages the placement of foreground content over background content in terminal applications. It handles sizing, positioning, and text wrapping to create modal-like experiences.
func New ¶
func New(theme *themes.Theme, opts ...OverlayOpt) *Overlay
New creates a new Overlay with the specified theme and optional configuration. The overlay is initialized with default settings and can be customized using the provided [OverlayOpt]s.
func (*Overlay) Place ¶
Place overlays the foreground content on top of the background content. The fg content is positioned in the center of the bg content, with the widthFraction determining how much of the available width should be used. The style is applied to the foreground content for borders, colors, etc.
Content that exceeds the available height will be truncated with a helpful message indicating how to view the full output.
type OverlayOpt ¶
type OverlayOpt func(*Overlay)
OverlayOpt is a functional option for configuring an Overlay.
func WithMinHeightPadding ¶
func WithMinHeightPadding(padding int) OverlayOpt
WithMinHeightPadding sets the minimum height padding reserved for overlays.
func WithMinWidth ¶
func WithMinWidth(minWidth int) OverlayOpt
WithMinWidth sets the minimum width of the overlay (in cells).