# `OpenUI.LiveView.Components`
[🔗](https://github.com/ideia4it/openui/blob/v0.1.1/lib/openui/live_view/components.ex#L2)

Maps a library's components to the host's function components.

    defmodule MyAppWeb.AssistantUI do
      use OpenUI.LiveView.Components,
        library: MyApp.Library,
        fields: %{"Input" => [name: "name", type: "input"]},
        forms: %{"Form" => "name"}

      def line_chart(assigns), do: ~H"..."
    end

Every catalog component needs a function named after it in snake case
(`LineChart` is `line_chart/1`), or the module does not compile. `fields`
names the components that are form fields (the prop that holds the field
name and the field's component type), and `forms` the components that
give a form name to their subtree (and the prop that holds it). A form
component renders a `<fieldset>` or a `<div>`, never a `<form>`: the
renderer already wraps the program in one.

The assigns each function receives are described in `OpenUI.LiveView`.

---

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