From 0f9faf8eed0fa140516f80b8c3a2bd7e20687dd6 Mon Sep 17 00:00:00 2001 From: mhartington Date: Thu, 1 Nov 2018 10:50:35 -0400 Subject: [PATCH] doc(): add new docs around tabs --- core/src/components/tab-button/readme.md | 21 +-------- .../components/tab-button/usage/javascript.md | 43 +++++++++++++++++++ core/src/components/tabs/readme.md | 22 +++++++++- core/src/components/tabs/usage/angular.md | 43 +++++++++++++++---- core/src/components/tabs/usage/javascript.md | 27 ++++++++++-- 5 files changed, 124 insertions(+), 32 deletions(-) create mode 100644 core/src/components/tab-button/usage/javascript.md diff --git a/core/src/components/tab-button/readme.md b/core/src/components/tab-button/readme.md index f4a6e34e02..10641c628e 100644 --- a/core/src/components/tab-button/readme.md +++ b/core/src/components/tab-button/readme.md @@ -1,25 +1,8 @@ # ion-tab-bar -Tab bar is the UI component that implements the array of button of `ion-tabs`. It's provided by default when `ion-tabs` is used, though, this "implicit" tab bar can not be customized. +Tab bar is a UI component that hold the array of [tab buttons](../tab-button). The Tab bar can provide a global setting for different tab/icon layouts as well as different positions for the bar itself. -In order to have a custom tab bar, it should be provided in user's markup as direct children of `ion-tabs`: - -```html - - - - - - - - - - -``` +See the [Tabs API Docs](../Tabs/) for more details on configuring Tabs. diff --git a/core/src/components/tab-button/usage/javascript.md b/core/src/components/tab-button/usage/javascript.md new file mode 100644 index 0000000000..41b996b72a --- /dev/null +++ b/core/src/components/tab-button/usage/javascript.md @@ -0,0 +1,43 @@ +```html + + + + + + Schedule + + + + + Speakers + + + + + Map + + + + + About + + + + + + + + + + + + + + + + + + + + +``` diff --git a/core/src/components/tabs/readme.md b/core/src/components/tabs/readme.md index a9341c2a41..71ac26111c 100644 --- a/core/src/components/tabs/readme.md +++ b/core/src/components/tabs/readme.md @@ -43,7 +43,7 @@ In order to link the button to the `ion-tab` container, a matching `tab` propert This `ion-tab-button` and `ion-tab` are now linked by the common `tab` property. -The `tab` property identifies each tab, and it has to be unique within the scope of the same `ion-tabs`. It's very important to set the same property to `ion-tab` and `ion-tab-button`, even if you are only using one. e.g. You could use the `ion-tab-bar` without using `ion-tabs`. In this case you should still give each `ion-tab` the property of `tab="something"`. +The `tab` property identifies each tab, and it has to be unique within the scope of the same `ion-tabs`. It's important to set the same property to `ion-tab` and `ion-tab-button`, even if you are only using one. e.g. You could use the `ion-tab-bar` without using `ion-tabs`. In this case you should still give each `ion-tab` the property of `tab="something"`. ### Router integration @@ -61,6 +61,26 @@ Would match the following tab: ``` +### Angular Router integration + +Using tabs with Angular's router is fairly straight forward. The only additional requirement is that an href is supplied to update the browser URL. In this way, the correct `ion-tab` is selected, and the URl is updated. + +```html + + + + + + Schedule + + + + + + + +``` + diff --git a/core/src/components/tabs/usage/angular.md b/core/src/components/tabs/usage/angular.md index 56fae51dfd..41b996b72a 100644 --- a/core/src/components/tabs/usage/angular.md +++ b/core/src/components/tabs/usage/angular.md @@ -1,16 +1,43 @@ ```html - - + + + + + Schedule + + + + + Speakers + + + + + Map + + + + + About + + + + + - - + + + - - + + + - - + + + + ``` diff --git a/core/src/components/tabs/usage/javascript.md b/core/src/components/tabs/usage/javascript.md index 721f6a57ea..d1b911884c 100644 --- a/core/src/components/tabs/usage/javascript.md +++ b/core/src/components/tabs/usage/javascript.md @@ -1,12 +1,31 @@ ```html - + - + - - + + + + + + + Schedule + + + + Speakers + + + + Map + + + + About + + ```