Dock menu for Mac OS fans

The PrimeFaces dock menu transforms images into a Mac-like dock menu, with icons that expand on rollover. Thus, the Dock component mimics the well-known dock interface of Mac OS X. The component consists of menu items and can be built declaratively or programmatically by model.

In this recipe we will develop a dock menu with social media icons.

How to do it...

Menu items should be direct children of p:dockMenu. We will take advantage of the url attribute, which is # in this sample, but represents a valid URL in the real world.

<p:dock id="dock" position="bottom"> <p:menuitem value="Digg" icon="/resources/images/dock/digg.png" url="#"/> <p:menuitem value="Facebook" icon="/resources/images/dock/facebook.png" url="#"/> <p:menuitem ...

Get PrimeFaces Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.