# `A2UICore.Catalog.Component`
[🔗](https://github.com/a2ui-elixir/a2ui/blob/v0.1.1/umbrella/apps/a2ui_core/lib/a2ui_core/catalog/component.ex#L1)

A component a catalog declares: the name a message uses and its JSON
Schema as the catalog document writes it (with its `allOf` mixins and
references), plus the v1.0 composition constraints (`allowedParents`,
`allowedChildren`).

`:from_document` says the schema was read from a catalog document, so
`A2UICore.Catalog.to_json/1` writes it back exactly; for a component
defined in code, local references to common types point at the
common types document instead.

# `t`
*since 0.1.0* 

```elixir
@type t() :: %A2UICore.Catalog.Component{
  allowed_children: [String.t()] | nil,
  allowed_parents: [String.t()] | nil,
  from_document: boolean(),
  name: String.t(),
  schema: map()
}
```

# `from_schema`
*since 0.1.0* 

```elixir
@spec from_schema(String.t(), map(), keyword()) :: t()
```

Builds a component from a catalog document entry.

Options: `from_document: true` marks a schema read from a document.

---

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