Skip to main content
Version: v6

ion-menu-toggle

shadow

Contents

The MenuToggle component can be used to toggle a menu open or closed.

By default, it's only visible when the selected menu is active. A menu is active when it can be opened/closed. If the menu is disabled or it's being presented as a split-pane, the menu is marked as non-active and ion-menu-toggle hides itself.

In case it's desired to keep ion-menu-toggle always visible, the autoHide property can be set to false.

Usage

<ion-app>
<ion-menu side="start" menuId="first" contentId="main">
<ion-header>
<ion-toolbar color="secondary">
<ion-title>Example Menu</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-list>
<ion-item>Menu Item</ion-item>
</ion-list>
</ion-content>
</ion-menu>
<div class="ion-page" id="main">
<ion-content class="ion-padding">
<ion-menu-toggle>
<ion-button>Toggle Menu</ion-button>
</ion-menu-toggle>
</ion-content>
</div>
</ion-app>

Properties

autoHide

DescriptionAutomatically hides the content when the corresponding menu is not active.

By default, it's true. Change it to false in order to keep ion-menu-toggle always visible regardless the state of the menu.
Attributeauto-hide
Typeboolean
Defaulttrue
DescriptionOptional property that maps to a Menu's menuId prop. Can also be start or end for the menu side. This is used to find the correct menu to toggle.

If this property is not used, ion-menu-toggle will toggle the first menu that is active.
Attributemenu
Typestring ๏ฝœ undefined
Defaultundefined

Slots

NameDescription
``Content is placed inside the toggle to act as the click target.