arya-blue
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga-blue
vela-blue
LightSwitch

Automatically sets a light or dark theme based on the OS settings. Put it in your template like:

<pe:lightSwitch selected="\#{userBean.theme}"/>

userBean should be a session scoped bean with a String type theme property (with both getter and setter). Then set the theme in your web.xml like:

<context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>\#{userBean.theme}</param-value>
</context-param>

This showcase uses the LightSwitch component.

See also the PrimeFaces themes documentation.

OmniFaces CombinedResourceHandler

With combined resources, we cannot find the theme link in the DOM tree. Therefor we need to add a node for the new theme.
Important: this node will be added as the last element in the body. If you added a custom style sheet with overrides, make sure to use more specific rules. Equal rules will be overruled by the switched theme.

Components and more
Documentation pe:lightSwitch
Attributes (move mouse over the names to see data types)
Name Description
automaticWhether to automatically switch themes based on OS settings.Default is true.
bindingAn EL expression referring to a server side UIComponent instance in a backing bean.Default is generated.
darkThe dark theme name.Default is arya-blue.
idUnique identifier of the component in a namingContainer.Default is generated.
lightThe light theme name.Default is saga-blue.
renderedBoolean value to specify the rendering of the component, when set to false component will not be rendered.Default is true.
selectedThe currently selected theme name.
widgetVarName of the client side widget.
PrimeFaces Extensions Showcase - © 2011-2025,PrimeFaces: 16.0.0-SNAPSHOT,PrimeFaces Extensions: 16.0.0-SNAPSHOT,JSF: Apache MyFaces Core 4.0 - Impl 4.0.3,Server: Apache Tomcat (TomEE)/10.1.52 (10.1.4),Build time: 2026-03-13 11:37