# `Dala.Ui.Component`
[🔗](https://github.com/manhvu/dala/blob/main/lib/dala/ui/component.ex#L1)

Central registry of all Dala UI components.

This is the SINGLE SOURCE OF TRUTH for:
- Component names and type atoms
- Allowed props per component
- Default props
- Component category (`:leaf` vs `:container`)
- Human-readable documentation

All other modules (Widgets, DSL, Renderer, Diff, DevTools) derive their
component knowledge from this module. To add a new component, define it
here and all other modules pick it up automatically.

# `category`

```elixir
@type category() :: :leaf | :container
```

# `t`

```elixir
@type t() :: %Dala.Ui.Component{
  category: category(),
  children_key: atom() | nil,
  defaults: map(),
  doc: String.t(),
  examples: [String.t()],
  name: atom(),
  props: [atom()],
  transform: (map() -&gt; map()) | nil,
  type: atom()
}
```

# `all`

```elixir
@spec all() :: [{atom(), t()}]
```

Get all components as a keyword list

# `container_components`

```elixir
@spec container_components() :: [{atom(), t()}]
```

Get container components as a keyword list

# `get`

```elixir
@spec get(atom()) :: t() | nil
```

Get a single component by name

# `leaf_components`

```elixir
@spec leaf_components() :: [{atom(), t()}]
```

Get leaf components as a keyword list

# `prop_schema`

```elixir
@spec prop_schema(atom()) :: [{atom(), keyword()}]
```

Get the prop schema for a component by name

# `props`

```elixir
@spec props(atom()) :: [atom()]
```

Get the props list for a component by name

# `transform_props`

```elixir
@spec transform_props(atom(), map()) :: map()
```

Apply a component's transform function to props

---

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