# `PhoenixKit.LayoutConfig`
[🔗](https://github.com/BeamLabEU/phoenix_kit/blob/v1.7.87/lib/phoenix_kit/layout_config.ex#L1)

Configuration manager for PhoenixKit layout integration.

This module provides functions to retrieve and validate layout configuration
from the application environment, with fallback to default PhoenixKit layouts.

## Configuration

Configure layouts in your application config:

    # Minimal configuration - only app layout
    config :phoenix_kit, layout: {MyAppWeb.Layouts, :app}

    # Full configuration - both root and app layouts
    config :phoenix_kit,
      root_layout: {MyAppWeb.Layouts, :root},
      layout: {MyAppWeb.Layouts, :app}

    # With additional options
    config :phoenix_kit,
      layout: {MyAppWeb.Layouts, :app},
      page_title_prefix: "Auth"

## Usage

    iex> PhoenixKit.LayoutConfig.get_layout()
    {PhoenixKitWeb.Layouts, :app}

    iex> PhoenixKit.LayoutConfig.get_root_layout()
    {PhoenixKitWeb.Layouts, :root}

# `custom_layout?`

```elixir
@spec custom_layout?() :: boolean()
```

Checks if a custom layout is configured (not using default PhoenixKit layouts).

## Examples

    iex> Application.put_env(:phoenix_kit, :layout, {MyApp.Layouts, :app})
    iex> PhoenixKit.LayoutConfig.custom_layout?()
    true

    iex> Application.delete_env(:phoenix_kit, :layout)
    iex> PhoenixKit.LayoutConfig.custom_layout?()
    false

# `get_config`

```elixir
@spec get_config() :: map()
```

Gets all layout configuration as a map for debugging purposes.

## Examples

    iex> PhoenixKit.LayoutConfig.get_config()
    %{
      layout: {PhoenixKitWeb.Layouts, :app},
      root_layout: {PhoenixKitWeb.Layouts, :root},
      page_title_prefix: nil,
      custom_layout?: false
    }

# `get_layout`

```elixir
@spec get_layout() :: {module(), atom()}
```

Gets the configured app layout module and template.

Returns the configured layout tuple or falls back to default PhoenixKit layout.

## Examples

    iex> Application.put_env(:phoenix_kit, :layout, {MyApp.Layouts, :app})
    iex> PhoenixKit.LayoutConfig.get_layout()
    {MyApp.Layouts, :app}

    iex> Application.delete_env(:phoenix_kit, :layout)
    iex> PhoenixKit.LayoutConfig.get_layout()
    {PhoenixKitWeb.Layouts, :app}

# `get_page_title_prefix`

```elixir
@spec get_page_title_prefix() :: String.t() | nil
```

Gets the configured page title prefix for authentication pages.

## Examples

    iex> Application.put_env(:phoenix_kit, :page_title_prefix, "Auth")
    iex> PhoenixKit.LayoutConfig.get_page_title_prefix()
    "Auth"

    iex> Application.delete_env(:phoenix_kit, :page_title_prefix)
    iex> PhoenixKit.LayoutConfig.get_page_title_prefix()
    nil

# `get_root_layout`

```elixir
@spec get_root_layout() :: {module(), atom()}
```

Gets the configured root layout module and template.

Returns the configured root layout tuple or falls back to default PhoenixKit root layout.
Root layout is optional and defaults to app layout if not specified.

## Examples

    iex> Application.put_env(:phoenix_kit, :root_layout, {MyApp.Layouts, :root})
    iex> PhoenixKit.LayoutConfig.get_root_layout()
    {MyApp.Layouts, :root}

    iex> Application.delete_env(:phoenix_kit, :root_layout)
    iex> PhoenixKit.LayoutConfig.get_root_layout()
    {PhoenixKitWeb.Layouts, :root}

---

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