# `Macaw.Surface.Cell`
[🔗](https://github.com/dcoai/macaw/blob/v0.1.3/lib/macaw/surface/cell.ex#L1)

A cell: one component placed in a surface (spec/06 §3.2).

  * `component`, the component's name as its package registers it, matched by spelling;
  * `kind`, the kind it renders as, `:content` by default;
  * `settings`, its settings by parameter name, inline, plain data;
  * `slots`, each slot bound to a source: `%{source: name, fields: %{role => field},
    params: %{name => value}}`, a `many` role's fields a list;
  * `place`, where it sits in the grid: `%{x, y, w, h}` (spec/06 §3.3).

Names are strings; an atom is read as its spelling, and no atom is made from one.

# `place`

```elixir
@type place() :: %{
  x: non_neg_integer(),
  y: non_neg_integer(),
  w: pos_integer(),
  h: pos_integer()
}
```

# `slot`

```elixir
@type slot() :: %{
  source: String.t(),
  fields: %{required(String.t()) =&gt; String.t() | [String.t()]},
  params: map()
}
```

# `t`

```elixir
@type t() :: %Macaw.Surface.Cell{
  component: String.t(),
  kind: Macaw.Component.kind(),
  place: place() | nil,
  settings: %{required(String.t()) =&gt; term()},
  slots: %{required(String.t()) =&gt; slot()}
}
```

# `keys`

```elixir
@spec keys() :: [atom(), ...]
```

A cell's keys, in order.

# `new`

```elixir
@spec new(keyword() | map()) :: {:ok, t()} | {:error, [Macaw.Layers.Fault.t(), ...]}
```

A cell from a keyword list or a map with atom keys: `{:ok, cell}` or every fault at
once, by path from the cell.

---

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