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
Renders a theme controller dropdown.
Functions
Renders a theme controller dropdown.
Attributes
themes- List of theme names to show, or:allfor 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 tonil.mode(:atom) - :auto renders a toggle when the theme list is exactly two concrete themes of DIFFERING base (one light, one dark) and a dropdown otherwise; :dropdown and :toggle force the shape. :toggle raises unless the list is such a pair — a toggle over three states would have hidden state, and sun/moon semantics over two themes of the same base are false. (A :cycle mode was considered and rejected: hidden state, no accessibility story, and it makes configuration ORDER behavioural.)Defaults to
:auto. Must be one of:auto,:dropdown, or:toggle.Global attributes are accepted.