Search documentation of phoenix_kit

# PhoenixKitWeb.Components.Core.ThemeController (phoenix_kit v1.7.87)

Copy Markdown View Source

Shared theme controller component for admin and dashboard.

Provides a dropdown to select from available daisyUI themes. Supports filtering to show only specific themes.

## Summary

### Functions

theme_controller(assigns)

Renders a theme controller dropdown.

## Functions

# theme_controller(assigns)

Renders a theme controller dropdown.

## Attributes

- `themes` - List of theme names to show, or `:all` for all themes (default: `:all`)
- `id` - Unique ID for the dropdown (default: "theme-dropdown")
- `class` - Additional CSS classes

## Examples

    <%!-- All themes --%>
    <.theme_controller />

    <%!-- Only specific themes --%>
    <.theme_controller themes={["system", "light", "dark", "nord", "dracula"]} />

    <%!-- From config --%>
    <.theme_controller themes={Application.get_env(:phoenix_kit, :dashboard_themes, :all)} />

## Attributes

- `themes` (`:any`) - Defaults to `:all`.
- `id` (`:string`) - Defaults to `"theme-dropdown"`.
- `class` (`:string`) - Defaults to `nil`.
- Global attributes are accepted.