Skip to content

docs(tabs): update icon playgrounds to use addIcons usage #3757

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
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions static/usage/v7/tabs/router/angular/example_component_ts.md
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 });
}
}
```
18 changes: 16 additions & 2 deletions static/usage/v7/tabs/router/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Playground from '@site/src/components/global/Playground';

import javascript from './javascript.md';
import javascript_index_html from './javascript/index_html.md';
import javascript_index_ts from './javascript/index_ts.md';

import angular_app_component_html from './angular/app_component_html.md';
import angular_app_module_ts from './angular/app_module_ts.md';
import angular_app_routing_module_ts from './angular/app_routing_module_ts.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_home_page_module_ts from './angular/home_page_module_ts.md';
import angular_home_page_component_ts from './angular/home_page_component_ts.md';
Expand Down Expand Up @@ -44,10 +46,19 @@ import react_search_page_tsx from './react/search_page_tsx.md';
<Playground
version="7"
code={{
javascript,
javascript: {
files: {
'index.html': javascript_index_html,
'index.ts': javascript_index_ts,
},
dependencies: {
ionicons: '7.4.0',
},
},
angular: {
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.ts': angular_example_component_ts,
'src/app/home/home-page.component.ts': angular_home_page_component_ts,
'src/app/home/home-page.component.html': angular_home_page_component_html,
'src/global.css': angular_global_css,
Expand All @@ -65,6 +76,9 @@ import react_search_page_tsx from './react/search_page_tsx.md';
'src/app/app.component.html': angular_app_component_html,
'src/app/app-routing.module.ts': angular_app_routing_module_ts,
},
dependencies: {
ionicons: '7.4.0',
},
},
vue: {
files: {
Expand Down
35 changes: 35 additions & 0 deletions static/usage/v7/tabs/router/javascript/index_ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
```ts
import { defineCustomElements } from '@ionic/core/loader';

import { addIcons } from 'ionicons';
import { library, playCircle, radio, search } from 'ionicons/icons';

/* Core CSS required for Ionic components to work properly */
import '@ionic/core/css/core.css';

/* Basic CSS for apps built with Ionic */
import '@ionic/core/css/normalize.css';
import '@ionic/core/css/structure.css';
import '@ionic/core/css/typography.css';

/* Optional CSS utils that can be commented out */
import '@ionic/core/css/padding.css';
import '@ionic/core/css/float-elements.css';
import '@ionic/core/css/text-alignment.css';
import '@ionic/core/css/text-transformation.css';
import '@ionic/core/css/flex-utils.css';
import '@ionic/core/css/display.css';

/* Theme variables */
import './theme/variables.css';

/**
* On Ionicons 7.2+ these icons
* get mapped to a kebab-case key.
* Alternatively, developers can do:
* addIcons({ 'library': library, 'play-circle': playCircle, 'radio': radio, 'search': search });
*/
addIcons({ library, playCircle, radio, search });

defineCustomElements();
```
22 changes: 22 additions & 0 deletions static/usage/v8/tabs/router/angular/example_component_ts.md
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 });
}
}
```
18 changes: 16 additions & 2 deletions static/usage/v8/tabs/router/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import Playground from '@site/src/components/global/Playground';

import javascript from './javascript.md';
import javascript_index_html from './javascript/index_html.md';
import javascript_index_ts from './javascript/index_ts.md';

import angular_app_component_html from './angular/app_component_html.md';
import angular_app_module_ts from './angular/app_module_ts.md';
import angular_app_routing_module_ts from './angular/app_routing_module_ts.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_home_page_module_ts from './angular/home_page_module_ts.md';
import angular_home_page_component_ts from './angular/home_page_component_ts.md';
Expand Down Expand Up @@ -44,10 +46,19 @@ import react_search_page_tsx from './react/search_page_tsx.md';
<Playground
version="8"
code={{
javascript,
javascript: {
files: {
'index.html': javascript_index_html,
'index.ts': javascript_index_ts,
},
dependencies: {
ionicons: '7.4.0',
},
},
angular: {
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.ts': angular_example_component_ts,
'src/app/home/home-page.component.ts': angular_home_page_component_ts,
'src/app/home/home-page.component.html': angular_home_page_component_html,
'src/global.css': angular_global_css,
Expand All @@ -65,6 +76,9 @@ import react_search_page_tsx from './react/search_page_tsx.md';
'src/app/app.component.html': angular_app_component_html,
'src/app/app-routing.module.ts': angular_app_routing_module_ts,
},
dependencies: {
ionicons: '7.4.0',
},
},
vue: {
files: {
Expand Down
46 changes: 46 additions & 0 deletions static/usage/v8/tabs/router/javascript/index_ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
```ts
import { defineCustomElements } from '@ionic/core/loader';

import { addIcons } from 'ionicons';
import { library, playCircle, radio, search } from 'ionicons/icons';

/* Core CSS required for Ionic components to work properly */
import '@ionic/core/css/core.css';

/* Basic CSS for apps built with Ionic */
import '@ionic/core/css/normalize.css';
import '@ionic/core/css/structure.css';
import '@ionic/core/css/typography.css';

/* Optional CSS utils that can be commented out */
import '@ionic/core/css/padding.css';
import '@ionic/core/css/float-elements.css';
import '@ionic/core/css/text-alignment.css';
import '@ionic/core/css/text-transformation.css';
import '@ionic/core/css/flex-utils.css';
import '@ionic/core/css/display.css';

/**
* Ionic Dark Theme
* -----------------------------------------------------
* For more information, please see:
* https://ionicframework.com/docs/theming/dark-mode
*/

// import '@ionic/core/css/palettes/dark.always.css';
// import '@ionic/core/css/palettes/dark.class.css';
import '@ionic/core/css/palettes/dark.system.css';

/* Theme variables */
import './theme/variables.css';

/**
* On Ionicons 7.2+ these icons
* get mapped to a kebab-case key.
* Alternatively, developers can do:
* addIcons({ 'library': library, 'play-circle': playCircle, 'radio': radio, 'search': search });
*/
addIcons({ library, playCircle, radio, search });

defineCustomElements();
```