 
  •  Settings
    •  Change Theme
    •  Favorites
    •  Lock Screen
    •  Wallpaper
  •  5 Messages
    • Give me a call
    • Sales reports attached
    • About your invoice
    • Meeting today at 10pm
    • Out of office
  •  4 Notifications
    •  Pending tasks
    •  Meeting today at 3pm
    •  Download documents
    •  Book flight
  • 
Wednesday
Jan 26

Weather

New York, USA

21℃
  • Thursday 24
  • Friday 19
  • Saturday 15
  • Sunday 24
  • Monday 21
  • Tuesday 20
Jane Williams 
  •  Profile
  •  Privacy
  •  Settings
  •  Logout
  • Dashboard
    Dashboard
  • Components
    Components
    • Sample Page
    • Forms
    • Data
    • Panels
    • Overlays
    • Menus
    • Messages
    • Charts
    • File
    • Misc
  • Template Pages9
    Template Pages
    • Landing
    • Empty Page
    • Invoice
    • Wizard
    • Help
    • Login Page
    • Error Page
    • 404 Page
    • Access Denied Page
  • Menu Hierarchy
    Menu Hierarchy
    • Submenu 1
      • Submenu 1.1
        • Link 1.1.1
        • Link 1.1.2
        • Link 1.1.3
      • Submenu 1.2
        • Link 1.2.1
    • Submenu 2
      • Submenu 2.1
        • Link 2.1.1
        • Link 2.1.2
      • Submenu 2.2
        • Link 2.2.1
  • Utils
    Utils
  • Docs
    Docs

Getting Started

First of all, you'd need SASS to compile CSS, proceed to SASS Installation before beginning if you do not have SASS available in your command line.

Demo project has an integrated jetty plugin so running the sample is easy as building the css first followed by the mvn jetty:run command.

sass --update src/main/webapp/resources:src/main/webapp/resources --no-source-map
mvn jetty:run

Navigate to http://localhost:8095/ultima to view the demos which is exactly same as the live version.

Layout

Ultima provides a main template.xhtml and additional topbar, menu and footer fragments for the base layout. These xhtml files must be placed under WEB-INF folder and client pages should reference the template.xhtml as their template. Provided empty-page.xhtml is a sample content page using the main template.xhtml that defines "content" as the main ui:define placeholder.

Other required resources are the css, js and images that are located inside resources/ultima-layout folder, simply copy the ultima-layout folder to your %WEB-APP-FOLDER%/resources folder so that final path would be %WEB-APP-FOLDER%/resources/ultima-layout/. Please refer to demo app or maven project of the demo app as the reference.

Size

Ultima comes in two sizes, default is closer to the material design specification with bigger fonts and paddings whereas the alternative compact size shrinks the dimensions of the UI elements. To activate the compact mode add "layout-compact" style class to the h:body element at template.xhtml.

Theme

Ultima provides 12 PrimeFaces themes out of the box, setup of a theme simple as defining primefaces.THEME context parameter in web.xml such as "ultima-indigo". Full list of available themes are;

  • ultima-blue
  • ultima-blue-grey
  • ultima-brown
  • ultima-cyan
  • ultima-dark-blue
  • ultima-dark-green
  • ultima-green
  • ultima-grey
  • ultima-indigo
  • ultima-purple-amber
  • ultima-purple-cyan
  • ultima-teal

A custom theme can be developed by the following steps.

  • Choose a custom theme name such as ultima-myown.
  • Create a folder named primefaces-ultima-myown and place an empty theme.scss inside
  • Copy the sass folder from the distribution to your application.
  • Define the variables listed below and import the /sass/theme/_theme.scss file.
  • Build the scss to generate css
  • Set primefaces.THEME context parameter as ultima-myown
  • Either bundle the css in a jar file or serve from webapp/resources/primefaces-ultima-myown folder

Here are the variables required to create a theme, you may need to change the last line according to the relative path of the sass folder in your application.

$primaryColor: #009688;
$primaryDarkColor: #00695C;
$primaryLightColor: #80CBC4;
$accentColor: #CDDC39;
$accentDarkColor: #9E9D24;
$accentLightColor: #E6EE9C;
$accentTextColor: #212121;

@import '../sass/theme/_theme';

An example sass command to compile the css would be;

sass src/main/webapp/resources/primefaces-ultima-myown/theme.scss:src/main/webapp/resources/primefaces-ultima-myown/theme.css  --no-source-map

Watch mode is handy to avoid compiling everytime when a change is made, instead use the following command so that sass generates the file whenever you make a customization. This builds all css files whenever a change is made to any scss file.

sass --watch src/main/webapp/resources:src/main/webapp/resources --no-source-map

Same can also be applied to layout itself;

  • Choose a layout name such as layout-myown.
  • Create an empty file named layout-myown.scss inside resources/ultima-layout/css folder.
  • Define the variables listed below and import the /sass/layout/_layout.scss file.
  • Build the scss to generate css
  • Serve the css by importing it using a link tag or h:outputStylesheet.

Here are the variables required to create a layout, you may need to change the last line according to the relative path of the sass folder in your application.

$primaryColor: #03A9F4;
$primaryDarkColor: #0277BD;
$primaryLightColor: #81D4FA;
$accentColor: #FFC107;
$accentDarkColor: #FF8F00;
$accentLightColor: #FFE082;
$accentTextColor: #212121;
$darkMenuBgColor: #424242;
$darkMenuHoverColor: #676767;

@import '/../sass/layout/_layout';

Check out the video tutorial that follows the steps above to create the dark-blue theme and layout

For both cases, several .scss files such as _layout.scss, _theme.scss or _variables.scss has to be present relative to your scss files, these are available inside the sass folder in the distribution.

In case you'd like to customize the structure not just the colors, the _variables.scss is where the structural variables (e.g. font size, paddings) for the layout are defined.

$textColor: #212121;
$textSecondaryColor: #757575;

/* Material Mode */
$fontSize: 16px;
$lineHeight: 24px;
$headerFontSize: 16px;
$headerPadding: 10px 16px;
$contentFontSize: 16px;
$contentPadding: 10px 16px;
$inputHeaderFontSize: 16px;
$inputHeaderPadding: 10px 16px;
$inputFontSize: 16px;
$buttonFontSize: 16px;
$inputOptionFontSize: 16px;
$inputOptionPadding: 10px 14px;
$iconFontSize: 24px;

/* Compact Mode */
$c-fontSize: 14px;
$c-lineHeight: 18px;
$c-headerFontSize: 14px;
$c-headerPadding: 8px 14px;
$c-contentFontSize: 14px;
$c-contentPadding: 8px 14px;
$c-iconFontSize: 20px;
$c-buttonFontSize: 14px;
$c-inputFontSize: 14px;
$c-inputHeaderFontSize: 14px;
$c-inputHeaderPadding: 6px 10px;
$c-inputOptionFontSize: 14px;
$c-inputOptionPadding: 6px 10px;
$c-dtPadding: 6px 10px;

/* Common */
$hoverBgColor: #e8e8e8;
$hoverTextColor: #000000;
$dividerColor: #bdbdbd;
$dividerLightColor: #cacaca;
$grayBgColor: #757575;

Menu

Menu is a regular JSF component that supports PrimeFaces MenuModel API allowing both declarative and programmatic approaches. State is saved via a cookie and to remove it define a widgetVar to the menu and call PF('yourwidgetvar').clearMenuState(). To use the menu add the primefaces-ultima-{version}.jar to your classpath and import the http://primefaces.org/ultima namespace.

xmlns:pu="http://primefaces.org/ultima">

<pu:menu>
</pu:menu>

Menu has 3 modes, static, overlay and horizontal. Layout wrapper element in template.xhtml is used to define which mode to use by adding specific classes. List below indicates the style classes for each mode.

  • Static: "layout-wrapper menu-layout-static"
  • Overlay: "layout-wrapper menu-layout-overlay"
  • Horizontal: "layout-wrapper menu-layout-static menu-layout-horizontal"

For example to create a horizontal menu, the div element should be in following form;

<div class="layout-wrapper menu-layout-static menu-layout-horizontal">
    <ui:include src="./topbar.xhtml" />
    <ui:include src="./menu.xhtml" />
    
    <div class="layout-main">
        <ui:insert name="content"/>
        
        <ui:include src="./footer.xhtml" />
    </div>
</div>

It is also possible to leave the choice to the user by keeping the preference at a bean and usign an EL expression to bind it so that user can switch between modes. Sample application has an example implementation of such use case.

<div class="layout-wrapper menu-layout-static">

</div>

To add badge to submenu items;

<p:submenu id="themes" label="Themes" icon="&#xE40A;">
    <f:attribute name="badge" value="5" />
    ...
</p:submenu>

Profile Modes

There are two possible locations for the user profile menu, first version is inline located inside the main menu and second option is the topbar menu. For inline mode, profile content should be placed above the <pu:menu />component and for inline mode content goes in topbar-items list. The sample demo application provides examples for both cases and even takes it to the next step by making it dynamic with an EL expression.

RTL

Layout can be used in RTL orientation as well by adding "layout-rtl" to the "layout-wrapper" div in template.xhtml.

Utilities

Ultima provides various helper features such as material iconset compatible with PrimeFaces components and helper classes. Visit Utils page for details.

Ripple Effect

Various elements display a ripple element on mousedown event, if you prefer to remove this effect, simply remove the ripple.js and ripple.css files from template.xhtml.

Grid CSS

Ultima uses new PrimeFaces Grid CSS (ui-g-*) throughout the samples, we strongly suggest using Grid CSS as your layout framework as it is well tested and supported by PrimeFaces. Grid CSS is automatically included on newer versions however if your PrimeFaces version is older than 5.3.14, add the provided grid.css file under /ultima-layout/css/ folder to your template manually.

Migration Guide

2.1.0 to 2.1.1

  • Update layout.js and layout css files
  • Replace theme jar with new jar

2.0.2 to 2.1.0

  • Added configurator panel.
  • Update layout.js and layout css files.
  • Replace theme jar with new jar

2.0.1 to 2.0.2

  • Update layout css files

2.0.0 to 2.0.1

  • Added sample invoice, help and payment wizard pages.

1.1.6 to 2.0.0

  • Update UltimaMenu*.java file
  • Replace theme jar with new jar

1.1.5 to 1.1.6

  • Update layout.js, UltimaMenu*.java and layout css files
  • Replace theme jar with new jar

1.1.4 to 1.1.5

  • Update layout.js, UltimaMenu*.java and taglib files
  • Replace theme jar with new jar

1.1.3 to 1.1.4

  • Update layout.js and layout css files
  • Replace theme jar with new jar

1.1.2 to 1.1.3

  • Update layout-*.css files
  • Update theme jar

1.1.1 to 1.1.2

  • Update layout.js and layout css files
  • Replace theme jar with new jar

1.1.0 to 1.1.1

  • Update layout.js and layout css files
  • Replace theme jar with new jar

1.0.8 to 1.0.9

  • Update layout css files
  • Replace theme jar with new jar

1.0.7 to 1.0.8

  • Update layout.js and layout css files
  • Replace theme jar with new jar

1.0.6 to 1.0.7

  • Update theme jar, layout css files and layout.js. (Full Changelog)

1.0.5 to 1.0.6

  • Update theme jar and layout.js.

1.0.4 to 1.0.5

  • Update theme jar, layout-{color}.css and layout.js.

1.0.3 to 1.0.4

  • Update theme jar and layout.js

1.0.2 to 1.0.3

  • Update theme jar

1.0.1 to 1.0.2

  • Update theme jar

1.0 to 1.0.1

  • Update layout-*.css files
  • Update theme jar
PrimeFaces ULTIMA All Rights Reserved
settings clear
  • Menu
  • User Profile
  • Size
  • Orientation
  • Themes

Menu Modes

check Static
Overlay
Horizontal
Slim

Menu Colors

Dark
check Light
check Inline
Overlay
check Compact Size
Material Size
LTR
RTL
check