@@ -64,34 +64,70 @@ export class ToolbarBase extends Ion {
64
64
/**
65
65
* @name Toolbar
66
66
* @description
67
- * The toolbar is generic bar that sits above or below content.
68
- * Unlike an `Navbar`, `Toolbar` can be used for a subheader as well.
69
- * Since it's based on flexbox, you can place the toolbar where you
70
- * need it and flexbox will handle everything else. Toolbars will automatically
71
- * assume they should be placed before an `ion-content`, so to specify that you want it
72
- * below, you can add the property `position="bottom"`. This will change the flex order
67
+ * A Toolbar is a generic bar that is positioned above or below content.
68
+ * Unlike a [Navbar](../../nav/Navbar), a toolbar can be used as a subheader.
69
+ * Toolbars are positioned automatically at the `top`, but they can be
70
+ * positioned at the bottom by setting `position="bottom"` on the component.
71
+ *
72
+ *
73
+ * ### Buttons in a Toolbar
74
+ * Buttons placed in a toolbar should be placed inside of the `<ion-buttons>`
75
+ * element. An exception to this is a [menuToggle](../../menu/MenuToggle) button.
76
+ * It should not be placed inside of the `<ion-buttons>` element. Both the
77
+ * `<ion-buttons>` element and the `menuToggle` can be positioned inside of the
78
+ * toolbar using different properties. The below chart has a description of each
73
79
* property.
74
80
*
81
+ * | Property | Description |
82
+ * |-------------|-----------------------------------------------------------------------------------------------------------------------|
83
+ * | `start` | Positions element to the left of the content in `ios` mode, and directly to the right in `md` and `wp` mode. |
84
+ * | `end` | Positions element to the right of the content in `ios` mode, and to the far right in `md` and `wp` mode. |
85
+ * | `left` | Positions element to the left of all other elements. |
86
+ * | `right` | Positions element to the right of all other elements. |
87
+ *
88
+ * See [usage](#usage) below for some examples.
89
+ *
90
+ *
75
91
* @usage
76
92
* ```html
77
93
* <ion-toolbar>
94
+ * <ion-buttons start>
95
+ * <button>
96
+ * <ion-icon name="contact"></ion-icon>
97
+ * </button>
98
+ * <button>
99
+ * <ion-icon name="search"></ion-icon>
100
+ * </button>
101
+ * </ion-buttons>
78
102
* <ion-title>My Toolbar Title</ion-title>
79
103
* </ion-toolbar>
80
104
*
81
105
* <ion-toolbar>
82
106
* <ion-title>I'm a subheader</ion-title>
83
107
* </ion-toolbar>
84
108
*
85
- * <ion-content></ion-content>
109
+ * <ion-content></ion-content>
86
110
*
87
111
* <ion-toolbar position="bottom">
88
112
* <ion-title>I'm a subfooter</ion-title>
113
+ * <ion-buttons right>
114
+ * <button>
115
+ * <ion-icon name="menu"></ion-icon>
116
+ * </button>
117
+ * </ion-buttons>
89
118
* </ion-toolbar>
90
119
*
91
120
* <ion-toolbar position="bottom">
92
121
* <ion-title>I'm a footer</ion-title>
122
+ * <ion-buttons end>
123
+ * <button>
124
+ * <ion-icon name="more"></ion-icon>
125
+ * </button>
126
+ * <button>
127
+ * <ion-icon name="options"></ion-icon>
128
+ * </button>
129
+ * </ion-buttons>
93
130
* </ion-toolbar>
94
- *
95
131
* ```
96
132
*
97
133
* @property {any } [position] - set position of the toolbar, `top` or `bottom`.
@@ -134,20 +170,27 @@ export class Toolbar extends ToolbarBase {
134
170
* @name Title
135
171
* @description
136
172
* `ion-title` is a component that sets the title of the `Toolbar` or `Navbar`
173
+ *
137
174
* @usage
175
+ *
138
176
* ```html
139
177
* <ion-navbar *navbar>
140
178
* <ion-title>Tab 1</ion-title>
141
179
* </ion-navbar>
180
+ * ```
142
181
*
143
- *<!-- or if you wanted to create a subheader title-->
182
+ * Or to create a navbar with a toolbar as a subheader:
183
+ *
184
+ * ```html
144
185
* <ion-navbar *navbar>
145
186
* <ion-title>Tab 1</ion-title>
146
187
* </ion-navbar>
188
+ *
147
189
* <ion-toolbar>
148
- * <ion-title>SubHeader </ion-title>
190
+ * <ion-title>Subheader </ion-title>
149
191
* </ion-toolbar>
150
- * ```
192
+ * ```
193
+ *
151
194
* @demo /docs/v2/demos/title/
152
195
*/
153
196
@Component ( {
@@ -195,23 +238,6 @@ export class ToolbarItem {
195
238
toolbar && toolbar . addItemRef ( elementRef ) ;
196
239
navbar && navbar . addItemRef ( elementRef ) ;
197
240
this . inToolbar = ! ! ( toolbar || navbar ) ;
198
-
199
- // Deprecation warning
200
- if ( elementRef . nativeElement . tagName === 'ION-NAV-ITEMS' ) {
201
-
202
- if ( elementRef . nativeElement . hasAttribute ( 'primary' ) ) {
203
- console . warn ( '<ion-nav-items primary> has been renamed to <ion-buttons start>, please update your HTML' ) ;
204
- elementRef . nativeElement . setAttribute ( 'start' , '' ) ;
205
-
206
- } else if ( elementRef . nativeElement . hasAttribute ( 'secondary' ) ) {
207
- console . warn ( '<ion-nav-items secondary> has been renamed to <ion-buttons end>, please update your HTML' ) ;
208
- elementRef . nativeElement . setAttribute ( 'end' , '' ) ;
209
-
210
- } else {
211
- console . warn ( '<ion-nav-items> has been renamed to <ion-buttons>, please update your HTML' ) ;
212
- }
213
- }
214
-
215
241
}
216
242
217
243
@ContentChildren ( Button )
0 commit comments