• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources
Theme
Theme
Preset primefaces.THEME
Apple Liquid Glass style: translucent overlays, menus and bars that blur the page behind them, capsule buttons.
Color scheme color-scheme
Input style p-input-filled
Density data-p-density
Direction primefaces.DIR
Colors
Primary --p-primary-base
Surface --p-surface-*
Shape and motion
Button shape --p-button-border-radius
Shadows --p-*-shadow
Animations --p-transition-duration
Ripple --p-ripple-opacity
Border radius --p-border-radius-*
Typography
Focus ring
Form field
CSS
Only the tokens that differ from the preset.

                        
                    

Theme Configurator

ThemeConfigurator lets the user change the theme at runtime: preset, color scheme, input style, density, direction, primary color and the main tokens. The settings are kept in the browser and applied before the first paint of every page, so nothing flickers on load.

Inline

In the page, e.g. a settings page. The overlay of this showcase (palette button at the right edge) is the same component with mode="overlay", both stay in sync.

Theme
Theme
Preset primefaces.THEME
Apple Liquid Glass style: translucent overlays, menus and bars that blur the page behind them, capsule buttons.
Color scheme color-scheme
Input style p-input-filled
Density data-p-density
Direction primefaces.DIR
Colors
Primary --p-primary-base
Surface --p-surface-*
Shape and motion
Button shape --p-button-border-radius
Shadows --p-*-shadow
Animations --p-transition-duration
Ripple --p-ripple-opacity
Border radius --p-border-radius-*
Typography
Focus ring
Form field
Opened by another button

A button with data-tc-toggle and the client id of an overlay configurator opens it.

Setup

1. Enable it in the web.xml: the head renders a small script that applies the stored settings before the first paint, preset and direction are read from cookies on the server.


<context-param>
    <param-name>primefaces.THEME_CONFIGURATOR</param-name>
    <param-value>true</param-value>
</context-param>
            

2. Add the composite component, e.g. in the template (overlay) or on a settings page (inline). It needs no form.


<html xmlns:pc="jakarta.faces.composite/primefaces" dir="#{p:dir()}">
    ...
    <pc:themeConfigurator/>
    <pc:themeConfigurator mode="inline" presets="aura,lara" direction="false" export="false"/>
            

#{p:theme()} and #{p:dir()} return the preset and the direction of the request (chosen by the user or primefaces.THEME / primefaces.DIR).

Attributes

NameDefaultDescription
modeoverlayoverlay: a button at the edge of the window opens the panel; inline: the panel in the page.
presetsaura,lara,nora,material,metal,glassThe presets to choose from, comma separated (custom themes too); empty: no preset choice.
directiontrueWhether the user can choose the direction.
exporttrueWhether the CSS of the changes is shown to copy.
stylenullInline style of the container.
styleClassnullStyle class of the container.

Usage


<div class="card">
    <h5>Inline</h5>
    <p>In the page, e.g. a settings page. The overlay of this showcase (palette button at the right edge) is the same
        component with <code>mode="overlay"</code>, both stay in sync.</p>
    <pc:themeConfigurator id="inlineConfigurator" mode="inline" export="false"/>
</div>

<div class="card">
    <h5>Opened by another button</h5>
    <p>A button with <code>data-tc-toggle</code> and the client id of an overlay configurator opens it.</p>
    <button type="button" class="p-button p-widget p-button-text-icon-left" data-tc-toggle="themeConfigurator"
            aria-controls="themeConfigurator_panel">
        <span class="p-button-icon-left p-c pi pi-palette"></span><span class="p-button-text p-c">Open theme configurator</span>
    </button>
</div>