Tabris.js Navigation Drawer

Tabris.js provides cross-platform access to native gestures and controls through Javascript. In recent articles we have explored images, swipe to dismiss, user input and even parallax scrolling. Today we will explore another native control, The Navigation Drawer.

The Navigation Drawer is a control that can be accessed using a bezel swipe from the left, or tapping on the menu icon in the top left.

A drawer can be included in a Tabris.js app by instantiating the Drawer widget (only one Drawer can be created per app):

Drawers as Containers

Drawers act as containers, and thus can contain other controls and even actions on those controls:

The Page Selector

Finally, the Drawer is most often used in conjunction with the PageSelector control which enables navigation to all the Pages in your Tabris.js application. Simply add the PageSelector to the drawer to access this functionality.

To try the Drawer or any features of Tabris.js, login with your GitHub credentials and get started for free. For more tips and tricks with Tabris.js, follow us on Twitter.