Ionic 2 Menus

Ionic 2 Menus – Menu component enables us to create side-menus. Menu is basically side-menu which is displayed on button click or on drag out. Menus are displayed differently depending
upon the mode and this can be changed to any available menu types.
It is very simple to create side menu in Ionic 2.
Here in this tutorial we are going to explain how you can create side menus in ionic 2. You can also use our online editor to run the code online.

Ionic 2 Menus | Side Menus Example

Let us first create very basic menu-

Side Menu

You can create side menus simply as below-

Ionic 2 Menus Example:

   <ion-nav id="nav" #content [root]="rootPage"></ion-nav>
    <button ion-button menuToggle icon-only>
      <ion-icon name='menu' ></ion-icon>
<ion-menu [content]="content">

Try it »

If you run the above example it will produce the output something like this-

Ionic 2 Menus : Side Menus

Menu Options

Following Options are available for the menu options.

Option Type Description
content any A reference to the content element the menu should use.
id string Menu id.
side string This is used assign the side where menu will be placed, there are basically two positions – “left” and “right” . Default is “left”.
type string You can set the menu type as – “overlay”, “reveal” or “push”.
enabled boolean This is used to enable/disable menus. Default is true.
swipeEnabled boolean This is used to enable/disable menus. Default is true.
persistent string Whether or not the menu should persist on child pages. Default is false.


Following events are avilable-

Attribute Description
ionDrag When menu dragged open.
ionOpen When menu opened.
ionClose When menu closed.


Add Comment

📖 Read More