# `PhoenixMountable.Layout`
[🔗](https://github.com/hattoriai/phoenix_mountable/blob/v0.2.1/lib/phoenix_mountable/layout.ex#L2)

Components for a library's root layout, and a ready-made root layout.

A library with a document of its own (`layout: {MyLib.Layouts, :root}`)
renders the tags its page needs with these components:

    <!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="utf-8" />
        <PhoenixMountable.Layout.meta mount={@mount} />
        <PhoenixMountable.Layout.assets mount={@mount} />
        <.live_title>{assigns[:page_title] || "My Lib"}</.live_title>
      </head>
      <body>{@inner_content}</body>
    </html>

Or it uses `layout: {PhoenixMountable.Layout, :root}`, which renders that,
titled after the `:title` option of `use PhoenixMountable`.

Libraries without LiveView use `PhoenixMountable.HTML` in EEx templates.

# `assets`

Tags for the mount's asset entries, with the request's CSP nonces and
`phx-track-static`.

## Attributes

* `mount` (`PhoenixMountable.Mount`) (required)
* `only` (`:list`) - the entry names to render, all by default. Defaults to `nil`.

# `meta`

The `<meta>` tags the library's JavaScript reads: the CSRF token, the
LiveView socket path and transport, and the mount path. The browser helper
`PhoenixMountable.connect()` reads them.

## Attributes

* `mount` (`PhoenixMountable.Mount`) (required)

# `root`

A complete root layout: meta tags, assets and a title.

---

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