# `ExRatatui.Widgets.Block`
[🔗](https://github.com/mcass19/ex_ratatui/blob/v0.7.1/lib/ex_ratatui/widgets/block.ex#L1)

A container widget that provides borders and a title around other widgets.

Can be rendered standalone or used as the `:block` field on other widgets
for composition. Supported by: Paragraph, List, Table, Gauge, LineGauge,
Tabs, Checkbox, TextInput, Markdown, Textarea, Throbber, Popup, and WidgetList.

## Fields

  * `:title` - optional title string displayed on the top border
  * `:borders` - list of border sides: `:all`, `:top`, `:right`, `:bottom`, `:left`
  * `:border_style` - `%ExRatatui.Style{}` for border color/modifiers
  * `:border_type` - `:plain`, `:rounded`, `:double`, or `:thick`
  * `:style` - `%ExRatatui.Style{}` for the inner area
  * `:padding` - `{left, right, top, bottom}` inner padding

## Examples

    iex> %ExRatatui.Widgets.Block{title: "My Panel", borders: [:all], border_type: :rounded}
    %ExRatatui.Widgets.Block{
      title: "My Panel",
      borders: [:all],
      border_style: %ExRatatui.Style{},
      border_type: :rounded,
      style: %ExRatatui.Style{},
      padding: {0, 0, 0, 0}
    }

    iex> %ExRatatui.Widgets.Block{}
    %ExRatatui.Widgets.Block{
      title: nil,
      borders: [],
      border_style: %ExRatatui.Style{},
      border_type: :plain,
      style: %ExRatatui.Style{},
      padding: {0, 0, 0, 0}
    }

# `border_side`

```elixir
@type border_side() :: :all | :top | :right | :bottom | :left
```

# `border_type`

```elixir
@type border_type() :: :plain | :rounded | :double | :thick
```

# `t`

```elixir
@type t() :: %ExRatatui.Widgets.Block{
  border_style: ExRatatui.Style.t(),
  border_type: border_type(),
  borders: [border_side()],
  padding:
    {non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()},
  style: ExRatatui.Style.t(),
  title: String.t() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
