A hamburger menu is a common UI element, particularly for mobile and tablet design. Hamburger menus allow the user to easily show and hide a site or application’s main navigation menu to preserve screen real estate.
In this article, we will walk you through the basic steps for setting up a simple hamburger menu in UI Builder. You will see, step-by-step, how to create your own hamburger menu.
We will also walk through how to optimize the menu to be responsive; that is, make it only appear on mobile and tablet views.
These breakpoints are written using the mobile-first method.
Logic
Next, we describe the logic for the appearance of the menu, and change the appearance of the hamburger – by clicking on the header__burger element.
To do this, click on the element, then on the puzzle icon.
Then add the Codeless logic for adding and removing element classes on click.
Let’s walk through what this logic is doing, in plain English.
First, we have an “if” statement. The program looks at the classes for the element header__burger.
If the assigned class is active, then the program performs the “do” portion of the if function. In that section, the program removes the class active, causing the header__burger and header__menu to become inactive.
If the assigned class is not active, then the program performs the “else” portion of the if function. There, it adds the class active to both header__burger and header__menu, making them both active.
Done! Now you know how to quickly and easily create a hamburger menu for your application using Backendless UI Builder.
Thanks for reading, and as always, happy codeless coding!
Choosing the best no-code app builder for your project can be a daunting task. In this article, we walk you through the process and highlight some of our favorites.
Sharing custom items with other Backendless developers gives you the power to build once and use in multiple projects. Backendless has just made it easier to keep your items under your own control with Private sharing.
You can help expand Backendless' offerings by creating your own app templates, custom components, frontend and backend Codeless logic, and UI pages to share on Backendless Marketplace.