Enabling automatic expanding and collapsing for a sidebar navigation menu

UIKit 10 makes it possible to create a sidebar navigation menu that automatically expands and collapses. You might want to enable this feature to maximize the main work area of an application screen or to reduce visual overload for users.

At run time, the navigation menu is displayed as follows:

When the device width is between 1025 pixels and 1440 pixels, the navigation menu automatically collapses to 51 pixels wide and only the icons are displayed. If you hover over an item in the navigation menu while it is collapsed, the menu automatically expands, overlaying part of the screen.

When the screen is wider than 1440 pixels, the navigation menu is always expanded and does not overlay the main content.

Before you begin, make sure that you are not overriding the py-responsive-overrides.css file that is included with the pyEndUser skin in the UIKit rule. This file contains the breakpoint required for the automatic collapsing and expanding to function at run time.

To enable and use automatic expanding and collapsing:

Create a harness and add a screen layout to it.

On the General tab of the Screen layout properties dialog box, select a screen layout that contains a region on the left:

Header left

Header footer left

Left

On the Presentation tab, complete the following tasks:

Select the Optimized code option to use a flexbox-based layout, which automatically alters the width, height, and order of its contents to best fill the available space.

Select the Display advanced presentation options check box.

In the Custom CSS class field, enter collapse-nav-auto.

Click Submit.

If you are not using default navigation sections provided by the UIKit, such as pyWorkerPortalNavigation, make sure that you include the pyAutoCollapseLists section in your left panel. The pyAutoCollapseLists section embeds a script that automatically collapses any submenus in the navigation menu when the left panel shrinks.

Have a question? Get answers now.

About Pegasystems

Pegasystems is the leader in cloud software for customer engagement and operational excellence. If you’ve driven a car, used a credit card, called a company for service, opened an account, flown on a plane, submitted a claim, or performed countless other everyday tasks, chances are you’ve interacted with Pega. For the past 30 years, our technology – CRM, digital process automation, robotics, AI, and more – has empowered the world’s leading companies to achieve breakthrough results.