Raxol.Core.Renderer.View.Components.Box (Raxol v2.6.1)

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

new(opts \\ [])

Creates a new box view.

Options

  • :children - List of child views
  • :title - Optional title rendered in the top border
  • :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}

Examples

Box.new(children: [view1, view2], padding: 1)
Box.new(padding: {1, 2, 1, 2}, border: :single)