-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs(tabs): add playground for basic usage #3824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1d63cef
docs(tabs): add playground for basic usage
thetaPC c203487
docs(tabs): add warning for required tabbar
thetaPC 4781f9d
docs(tab): update note
thetaPC 7d41c81
docs(tabs): remove warning
thetaPC 3fe3f93
docs(tab): update note on when to use
thetaPC ce6783c
docs(tabs): add dark mode to vue router
thetaPC bd732de
docs(tabs): use correct syntax
thetaPC 109e036
docs(tabs): remove ion content
thetaPC cfb3567
Update docs/api/tab.md
thetaPC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
static/usage/v8/tabs/basic/angular/example_component_css.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
```css | ||
/* This style is for demonstration purposes only. */ | ||
/* It's not required for the tabs to function. */ | ||
.example-content { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
} | ||
``` |
71 changes: 71 additions & 0 deletions
71
static/usage/v8/tabs/basic/angular/example_component_html.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
```html | ||
<ion-tabs> | ||
<ion-tab tab="home"> | ||
<div id="home-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Listen now</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Listen now content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="radio"> | ||
<div id="radio-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Radio</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Radio content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="library"> | ||
<div id="library-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Library</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Library content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="search"> | ||
<div id="search-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Search</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Search content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
|
||
<ion-tab-bar slot="bottom"> | ||
<ion-tab-button tab="home"> | ||
<ion-icon name="play-circle"></ion-icon> | ||
Listen Now | ||
</ion-tab-button> | ||
<ion-tab-button tab="radio"> | ||
<ion-icon name="radio"></ion-icon> | ||
Radio | ||
</ion-tab-button> | ||
<ion-tab-button tab="library"> | ||
<ion-icon name="library"></ion-icon> | ||
Library | ||
</ion-tab-button> | ||
<ion-tab-button tab="search"> | ||
<ion-icon name="search"></ion-icon> | ||
Search | ||
</ion-tab-button> | ||
</ion-tab-bar> | ||
</ion-tabs> | ||
``` |
22 changes: 22 additions & 0 deletions
22
static/usage/v8/tabs/basic/angular/example_component_ts.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
```ts | ||
import { Component } from '@angular/core'; | ||
|
||
import { addIcons } from 'ionicons'; | ||
import { library, playCircle, radio, search } from 'ionicons/icons'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
templateUrl: 'example.component.html', | ||
styleUrls: ['example.component.css'], | ||
}) | ||
export class ExampleComponent { | ||
constructor() { | ||
/** | ||
* Any icons you want to use in your application | ||
* can be registered in app.component.ts and then | ||
* referenced by name anywhere in your application. | ||
*/ | ||
addIcons({ library, playCircle, radio, search }); | ||
} | ||
} | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Tabs</title> | ||
<link rel="stylesheet" href="../../common.css" /> | ||
<script src="../../common.js"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@8/dist/ionic/ionic.esm.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@8/css/ionic.bundle.css" /> | ||
<style> | ||
.example-content { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-tabs> | ||
<ion-tab tab="home"> | ||
<div id="home-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Listen now</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Listen now content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="radio"> | ||
<div id="radio-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Radio</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Radio content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="library"> | ||
<div id="library-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Library</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Library content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="search"> | ||
<div id="search-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Search</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Search content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
|
||
<ion-tab-bar slot="bottom"> | ||
<ion-tab-button tab="home"> | ||
<ion-icon name="play-circle"></ion-icon> | ||
Listen Now | ||
</ion-tab-button> | ||
<ion-tab-button tab="radio"> | ||
<ion-icon name="radio"></ion-icon> | ||
Radio | ||
</ion-tab-button> | ||
<ion-tab-button tab="library"> | ||
<ion-icon name="library"></ion-icon> | ||
Library | ||
</ion-tab-button> | ||
<ion-tab-button tab="search"> | ||
<ion-icon name="search"></ion-icon> | ||
Search | ||
</ion-tab-button> | ||
</ion-tab-bar> | ||
</ion-tabs> | ||
</ion-app> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Playground from '@site/src/components/global/Playground'; | ||
|
||
import javascript_index_html from './javascript/index_html.md'; | ||
import javascript_index_ts from './javascript/index_ts.md'; | ||
|
||
import react_main_tsx from './react/main_tsx.md'; | ||
import react_main_css from './react/main_css.md'; | ||
|
||
import vue from './vue.md'; | ||
|
||
import angular_example_component_html from './angular/example_component_html.md'; | ||
import angular_example_component_ts from './angular/example_component_ts.md'; | ||
import angular_example_component_css from './angular/example_component_css.md'; | ||
|
||
<Playground | ||
version="8" | ||
code={{ | ||
javascript: { | ||
files: { | ||
'index.html': javascript_index_html, | ||
'index.ts': javascript_index_ts, | ||
}, | ||
}, | ||
react: { | ||
files: { | ||
'src/main.tsx': react_main_tsx, | ||
'src/main.css': react_main_css, | ||
}, | ||
}, | ||
vue, | ||
angular: { | ||
files: { | ||
'src/app/example.component.html': angular_example_component_html, | ||
'src/app/example.component.ts': angular_example_component_ts, | ||
'src/app/example.component.css': angular_example_component_css, | ||
}, | ||
}, | ||
}} | ||
src="usage/v8/tabs/basic/demo.html" | ||
devicePreview | ||
includeIonContent={false} | ||
/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
```html | ||
<ion-tabs> | ||
<ion-tab tab="home"> | ||
<div id="home-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Listen now</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Listen now content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="radio"> | ||
<div id="radio-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Radio</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Radio content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="library"> | ||
<div id="library-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Library</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Library content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
<ion-tab tab="search"> | ||
<div id="search-page"> | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Search</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<div class="example-content">Search content</div> | ||
</ion-content> | ||
</div> | ||
</ion-tab> | ||
|
||
<ion-tab-bar slot="bottom"> | ||
<ion-tab-button tab="home"> | ||
<ion-icon name="play-circle"></ion-icon> | ||
Listen Now | ||
</ion-tab-button> | ||
<ion-tab-button tab="radio"> | ||
<ion-icon name="radio"></ion-icon> | ||
Radio | ||
</ion-tab-button> | ||
<ion-tab-button tab="library"> | ||
<ion-icon name="library"></ion-icon> | ||
Library | ||
</ion-tab-button> | ||
<ion-tab-button tab="search"> | ||
<ion-icon name="search"></ion-icon> | ||
Search | ||
</ion-tab-button> | ||
</ion-tab-bar> | ||
</ion-tabs> | ||
|
||
<style> | ||
/* This style is for demonstration purposes only. */ | ||
/* It's not required for the tabs to function. */ | ||
.example-content { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
height: 100%; | ||
} | ||
</style> | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.