Raxol. Core. Renderer. View. Components. Box
(Raxol v2.9.2)
View Source
Constructs :box-tagged View DSL nodes (new/1) with content, padding,
border, and margin metadata for the box model.
This module only builds the node; it does not compute layout. The live
engine (Raxol.UI.Layout.Engine) computes positions for :box elements
independently of this module.
Summary
Functions
Creates a new box view.
Functions
Creates a new box view.
Options
:children- List of child views:title- Optional title rendered in the top border:style- Style map or keyword list:padding- Padding around content (integer or {top, right, bottom, left}):margin- Margin around box (integer or {top, right, bottom, left}):border- Border style (:none, :single, :double, :rounded, :bold, :dashed):fg- Foreground color:bg- Background color:size- Box size {width, height}
:padding, :border, :fg, :bg, :border_bg and :background_clip
are shorthands for the matching :style keys; a value given in :style
takes precedence.
Examples
Box.new(children: [view1, view2], padding: 1)
Box.new(padding: {1, 2, 1, 2}, border: :single)