You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most simple layout available consists of a [header](../api/header.md) and [content](../api/content.md). Most pages in an app generally have both of these, but a header is not required in order to use content.
30
24
31
-
```html
32
-
<ion-app>
33
-
<ion-header>
34
-
<ion-toolbar>
35
-
<ion-title>Header</ion-title>
36
-
</ion-toolbar>
37
-
</ion-header>
25
+
import Header from '@site/static/usage/v7/header/basic/index.md';
As you can see, a toolbar in a header appears above the content. Sometimes an app needs to have a toolbar below the content, which is when a footer is used.
54
-
55
-
```html
56
-
<ion-app>
57
-
<ion-contentclass="ion-padding">
58
-
<h1>Main Content</h1>
59
-
</ion-content>
31
+
While a toolbar in a header appears above the content, a footer appears below the content. A header and a footer can also be used together on the same page.
60
32
61
-
<ion-footer>
62
-
<ion-toolbar>
63
-
<ion-title>Footer</ion-title>
64
-
</ion-toolbar>
65
-
</ion-footer>
66
-
</ion-app>
67
-
```
33
+
import Footer from '@site/static/usage/v7/footer/basic/index.md';
68
34
69
-
### Header and Footer
35
+
<Footer />
70
36
71
-
These can also be combined on one page to have a toolbar above _and_ below the content.
72
37
73
-
```html
74
-
<ion-app>
75
-
<ion-header>
76
-
<ion-toolbar>
77
-
<ion-title>Header</ion-title>
78
-
</ion-toolbar>
79
-
</ion-header>
80
-
81
-
<ion-contentclass="ion-padding">
82
-
<h1>Main Content</h1>
83
-
</ion-content>
38
+
## Tabs Layout
84
39
85
-
<ion-footer>
86
-
<ion-toolbar>
87
-
<ion-title>Footer</ion-title>
88
-
</ion-toolbar>
89
-
</ion-footer>
90
-
</ion-app>
91
-
```
40
+
A layout consisting of horizontal [tabs](../api/tabs.md) can be used to let the user quickly change between content views. Each tab can contain static content or a navigation stack by using a [router outlet](../api/router-outlet.md) or [nav](../api/nav.md).
92
41
93
-
### Live examples
94
42
95
-
You can view a live example of this setup in Angular [here](https://stackblitz.com/edit/ionic-ng-header-footer) and in React [here](https://stackblitz.com/edit/ionic-react-head-foot).
43
+
import Tabs from '@site/static/usage/v7/tabs/router/index.md';
96
44
97
-
## Tabs Layout
45
+
<Tabs/>
98
46
99
-
A layout consisting of horizontal [tabs](../api/tabs.md) can be used to let the user quickly change between content views. Each tab can contain static content or a navigation stack by using an `ion-router-outlet` or `ion-nav`.
100
-
101
-
```html
102
-
<ion-app>
103
-
<ion-tabs>
104
-
<ion-tabtab="home">
105
-
<h1>Home Content</h1>
106
-
</ion-tab>
107
-
<ion-tabtab="settings">
108
-
<h1>Settings Content</h1>
109
-
</ion-tab>
110
-
111
-
<ion-tab-barslot="bottom">
112
-
<ion-tab-buttontab="home">
113
-
<ion-label>Home</ion-label>
114
-
<ion-iconname="home"></ion-icon>
115
-
</ion-tab-button>
116
-
<ion-tab-buttontab="settings">
117
-
<ion-label>Settings</ion-label>
118
-
<ion-iconname="settings"></ion-icon>
119
-
</ion-tab-button>
120
-
</ion-tab-bar>
121
-
</ion-tabs>
122
-
</ion-app>
123
-
```
124
-
125
-
### Live examples
126
-
127
-
You can view a live example of this setup in Angular [here](https://stackblitz.com/edit/ionic-ng-tabs) and in React [here](https://stackblitz.com/edit/ionic-react-tab-layout).
128
47
129
48
## Menu Layout
130
49
131
50
A standard layout among mobile apps includes the ability to toggle a side [menu](../api/menu.md) by clicking a button or swiping it open from the side. Side menus are generally used for navigation, but they can contain any content.
132
51
133
-
```html
134
-
<ion-app>
135
-
<ion-menucontent-id="main-content">
136
-
<ion-header>
137
-
<ion-toolbarcolor="primary">
138
-
<ion-title>Menu</ion-title>
139
-
</ion-toolbar>
140
-
</ion-header>
141
-
142
-
<ion-content>
143
-
<ion-list>
144
-
<ion-list-header> Navigate </ion-list-header>
145
-
<ion-menu-toggleauto-hide="false">
146
-
<ion-itembutton>
147
-
<ion-iconslot="start"name="home"></ion-icon>
148
-
<ion-label> Home </ion-label>
149
-
</ion-item>
150
-
</ion-menu-toggle>
151
-
</ion-list>
152
-
</ion-content>
153
-
</ion-menu>
154
-
155
-
<ion-pageclass="ion-page"id="main-content">
156
-
<ion-header>
157
-
<ion-toolbar>
158
-
<ion-buttonsslot="start">
159
-
<ion-menu-toggle>
160
-
<ion-button>
161
-
<ion-iconslot="icon-only"name="menu"></ion-icon>
162
-
</ion-button>
163
-
</ion-menu-toggle>
164
-
</ion-buttons>
165
-
<ion-title>Header</ion-title>
166
-
</ion-toolbar>
167
-
</ion-header>
168
-
<ion-contentclass="ion-padding">
169
-
<h1>Main Content</h1>
170
-
<p>Click the icon in the top left to toggle the menu.</p>
171
-
</ion-content>
172
-
</ion-page>
173
-
</ion-app>
174
-
175
-
<ion-menu-controller></ion-menu-controller>
176
-
```
177
-
178
-
### Live examples
179
-
180
-
You can view a live example of this setup in Angular [here](https://stackblitz.com/edit/ionic-ng-menu-layout) and in React [here](https://stackblitz.com/edit/ionic-react-menu).
52
+
import Menu from '@site/static/usage/v7/menu/basic/index.md';
53
+
54
+
<Menu />
55
+
181
56
182
57
## Split Pane Layout
183
58
184
59
A [split pane](../api/split-pane.md) layout has a more complex structure because it can combine the previous layouts. It allows for multiple views to be displayed when the viewport is above a specified breakpoint. If the device's screen size is below a certain size, the split pane view will be hidden.
185
60
186
-
By default, the split pane view will show when the screen is larger than `768px`, or the `md` breakpoint, but this can be customized to use different breakpoints by setting the `when` property. Below is an example where the split pane contains a menu that is visible for `sm` screens and up, or when the viewport is larger than `576px`. By resizing the browser horizontally so that the app is smaller than this, the split pane view will disappear.
It's important to note that the element with the `id` matching the `content-id` specified by the split pane will be the main content that is always visible. This can be any element, including an [ion-nav](../api/nav.md), [ion-router-outlet](../api/router-outlet.md), or an [ion-tabs](../api/tabs.md).
233
-
234
-
### Live examples
235
-
236
-
You can view a live example of this setup in Angular [here](https://stackblitz.com/edit/ionic-ng-split-pane) and in React [here](https://stackblitz.com/edit/ionic-react-split-pane).
61
+
By default, the split pane view will show when the screen is larger than `768px`, or the `md` breakpoint, but this can be customized to use different breakpoints by setting the `when` property. Below is an example where the split pane contains a menu that is visible for `xs` screens and up, or when the viewport is larger than `0px`. This will show the split pane for all screen sizes.
62
+
63
+
It's important to note that the element with the `id` matching the `contentId` specified by the split pane will be the main content that is always visible. This can be any element, including a [nav](../api/nav.md), [router outlet](../api/router-outlet.md), or [tabs](../api/tabs.md).
64
+
65
+
import SplitPane from '@site/static/usage/v7/split-pane/basic/index.md';
0 commit comments