FrappeUIPhx.Components.ThemeSwitcher (frappe_ui_phx v0.3.1)

Copy Markdown View Source

Alternador claro/escuro. Cada opção é um link ?theme=… tratado por FrappeUIPhx.Plug.Theme, que persiste a escolha em sessão e cookie; o tema atual (current) vem do servidor (@frappe_ui_theme). Experimental.

Summary

Functions

Link relativo que aplica o tema ("?theme=dark").

Functions

href(param, theme)

@spec href(String.t(), String.t()) :: String.t()

Link relativo que aplica o tema ("?theme=dark").

theme_switcher(assigns)

Attributes

  • current (:string) (required) - tema ativo: "light" ou "dark".
  • param (:string) - nome do parâmetro lido pelo Plug. Defaults to "theme".
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.