Theme
arya
luna-amber
luna-blue
luna-green
luna-pink
nova-dark
nova-light
saga
vela
LightSwitch
LightSwitch JavaScript API.

Source

<p><p:toggleSwitch onchange="PF('lightSwitch').toggle()"/></p>

    <p><p:button value="Dark" onclick="PF('lightSwitch').dark();return false"/></p>

    <p><p:button value="Light" onclick="PF('lightSwitch').light();return false"/></p>
            
Components and more
Documentation pe:lightSwitch
Attributes (move mouse over the names to see data types)
Name Description
id Unique identifier of the component in a namingContainer.
rendered Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding An el expression referring to a server side UIComponent instance in a backing bean.
widgetVar Name of the client side widget.
selected Selected theme. Should point to a value in a session scoped bean which you should also use as the context param 'primefaces.THEME'.
light Light theme. Default 'saga'.
dark Dark theme. Default 'arya'.
automatic Flag indicating to switch to the theme based on the OS setting automatically. Default true.
Events (move mouse over the names to see classes)
Name Description
switchfires on switch
PrimeFaces Extensions Showcase - © 2011-2023,PrimeFaces: 13.0.0,PrimeFaces Extensions: 13.0.1,JSF: Apache MyFaces JSF-2.3 Core Impl 2.3.10,Server: jetty/9.4.36.v20210114,Build time: 2023-09-11 19:07