Introduction

A beautiful multilevel collapsible menu (maximum of 3, I recommend that we don’t need more than 3 levels) on the side menu (app drawer), NOW ON IONIC 2. Works as a clean component You are all set!

I always take it serious to keep the code quality high, with clean and self-explained code. When purchasing this, you also get my latest “helper” snippets inside the package to make it more fun to code.

Preview

Watch on Youtube

See how it works on Youtube: https://youtu.be/PxrNPYPFiEY

Happy prototyping!

Changelog

Last updated: Jul 6 2017

v1

  • First version

v2

  • Migrate to Ionic 3

Screens

  • Come as a component
  • Customizable color
  • Nice animation effect

Run locally

1.Install Ionic environment

$ npm install -g cordova
$ npm install -g ionic@4.11.0

2.After purchasing, download the zip file containing the entire demo app and unzip

3.Go inside the extracted folder

4.Install all dependencies

$ npm install

5.Start local server

$ ionic serve

6.Your default browser should now automatically open the app

Notes

Background color for the active menu item

# src/components/multilevel-menu/multilevel-menu.scss
$activeColor: #f53d3d;

Categories Data Structure

{
        name: "Electronics",
        id: 4,
        items: [
          {
            name: "TV",
            id: 40,
            items: [
              ................
              {
                name: "Sony",
                id: 402
              },
              {
                name: "Other - custom URL",
                url: '/app/other'
              }
            ]
			.............

Include directive in a template

<multilevel-menu [categories]="categories" (onSelect)="onMenuSelect($event)" [selectedCategory]="selectedCategory"></multilevel-menu>

Event handler for onSelect

In the parent component you can get the selected category by creating your handler

# src/app/app.component.ts
onMenuSelect(cat) {
    console.info('In app.components: selected category', cat);
    this.selectedCategory = cat;
    this.nav.setRoot(Home, {
      selectedCategory: cat
    })
  }

Contact

If you need technical support or have any questions, don’t hesitate to send me a message: mr_hie@yahoo.com

Homepage: https://www.takethatdesign.com


<StartOfPromotion>

[PROMO] Ionic 3 Bundle: 6 in 1

Proudly introduce the best of my Ionic 3 products: 3 themes + 3 plugins in Studio Pack #2 now on sale with promotion code 19SPEED. Please click the button below for more information.

Purchase Externally

</EndOfPromotion>