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.
<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>