Constructors for %ExRatatui.Widgets.Block{} padding tuples.
Block's :padding field is a {left, right, top, bottom} tuple of
non-negative integers. Writing those out by hand is noisy for the
common symmetric cases — these helpers mirror ratatui's Padding
constructors and return the tuple Block already accepts, so they
drop straight into padding:.
%Block{padding: ExRatatui.Layout.Padding.uniform(1)}
%Block{padding: ExRatatui.Layout.Padding.symmetric(2, 1)}Every helper returns a plain {l, r, t, b} tuple — there is no
struct and no runtime cost beyond building the tuple.
Summary
Functions
Padding on left + right only; top + bottom are zero.
Explicit per-side padding. The identity constructor — included so a
call site can stay in the Padding.* namespace for all four cases.
Horizontal padding on left + right, vertical padding on top + bottom.
The same padding on all four sides.
Padding on top + bottom only; left + right are zero.
Types
@type t() :: {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()}
Functions
@spec horizontal(non_neg_integer()) :: t()
Padding on left + right only; top + bottom are zero.
Examples
iex> ExRatatui.Layout.Padding.horizontal(2)
{2, 2, 0, 0}
@spec new(non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()) :: t()
Explicit per-side padding. The identity constructor — included so a
call site can stay in the Padding.* namespace for all four cases.
Examples
iex> ExRatatui.Layout.Padding.new(1, 2, 3, 4)
{1, 2, 3, 4}
@spec symmetric(non_neg_integer(), non_neg_integer()) :: t()
Horizontal padding on left + right, vertical padding on top + bottom.
Examples
iex> ExRatatui.Layout.Padding.symmetric(3, 1)
{3, 3, 1, 1}
@spec uniform(non_neg_integer()) :: t()
The same padding on all four sides.
Examples
iex> ExRatatui.Layout.Padding.uniform(2)
{2, 2, 2, 2}
@spec vertical(non_neg_integer()) :: t()
Padding on top + bottom only; left + right are zero.
Examples
iex> ExRatatui.Layout.Padding.vertical(1)
{0, 0, 1, 1}