A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
MIT License
Bot releases are visible (Hide)
Published by liamdebeasi over 5 years ago
Published by brandyscarney over 5 years ago
Published by brandyscarney over 5 years ago
Published by brandyscarney over 5 years ago
Published by manucorporat over 5 years ago
Enjoy! 🎈
Published by manucorporat almost 6 years ago
NavController.goBack()
renamed to NavController.back()
Published by manucorporat almost 6 years ago
(ionChange)
becomes (ionTabsDidChange)
Previously the getSelected()
method of ion-tabs
returned a reference to the selected
ion-tab
, now it returns the name of tab as string.
Published by manucorporat almost 6 years ago
In order to speed up the build and reduce the main bundle size,
we have moved the ionicons outside the webpack build pipeline.
Instead, a new copy task needs to be added to the angular.json
, specifically to the
the "assets"
option of the "build"
.
{
"projects": {
"app": {
"architect": {
"build": {
"options": {
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
+ {
+ "glob": "**/*.svg",
+ "input": "node_modules/ionicons/dist/ionicons/svg",
+ "output": "./svg"
+ }
Published by manucorporat almost 6 years ago
Published by manucorporat almost 6 years ago
Removes the --width
and --height
variables from the following components, in favor of CSS:
--width
/--height
and adds a --size
variable that is set on the width and height, allowing width and height to still be set and border-radius to still use it as a variable--width
/--height
and --inner-width
/--inner-height
variables. Calculates inner values based on parent element size.The following components have all be converted to shadow (or scoped) and have CSS variables for width/height:
The above components will now have the following CSS variables for consistency among overlays:
Name |
---|
--height |
--max-height |
--max-width |
--min-height |
--min-width |
--width |
If the component does not set the value, it will default to auto
.
The following CSS properties have been removed:
Component | Property | Reason |
---|---|---|
Button | --height |
Use CSS instead |
Button | --margin-bottom |
Use CSS instead |
Button | --margin-end |
Use CSS instead |
Button | --margin-start |
Use CSS instead |
Button | --margin-top |
Use CSS instead |
Button | --width |
Use CSS instead |
Checkbox | --height |
Use CSS or --size
|
Checkbox | --width |
Use CSS or --size
|
FAB Button | --width |
Use CSS instead |
FAB Button | --height |
Use CSS instead |
FAB Button | --margin-bottom |
Use CSS instead |
FAB Button | --margin-end |
Use CSS instead |
FAB Button | --margin-start |
Use CSS instead |
FAB Button | `--margin-top | Use CSS instead |
Menu | --width-small |
Use a media query and --width
|
Radio | --width |
Use CSS instead |
Radio | --height |
Use CSS instead |
Radio | --inner-height |
Calculated based on parent |
Radio | --inner-width |
Calculated based on parent |
Renamed [mini]
attribute to [size=small]
in ion-fab-button
.
- <ion-fab-button mini></ion-fab-button>
+ <ion-fab-button size="small"></ion-fab-button>
Published by manucorporat almost 6 years ago
Tabs got the last bit of changes needed in order to support lazy loading of components. To support this, some changes are required for the router config. Using the tabs starter as an example, here's a diff of the changes:
import { RouterModule, Routes } from '@angular/router';
import { TabsPage } from './tabs.page';
-import { Tab1Page } from '../tab1/tab1.page';
-import { Tab2Page } from '../tab2/tab2.page';
-import { Tab3Page } from '../tab3/tab3.page';
const routes: Routes = [
{
path: 'tabs',
component: TabsPage,
children: [
- {
- path: '',
- redirectTo: '/tabs/(tab1:tab1)',
- pathMatch: 'full',
- },
{
path: 'tab1',
- outlet: 'tab1',
- component: Tab1Page
+ children: [
+ {
+ path: '',
+ loadChildren: '../tab1/tab1.module#Tab1PageModule'
+ }
+ ]
},
{
path: 'tab2',
- outlet: 'tab2',
- component: Tab2Page
+ children: [
+ {
+ path: '',
+ loadChildren: '../tab2/tab2.module#Tab2PageModule'
+ }
+ ]
},
{
path: 'tab3',
- outlet: 'tab3',
- component: Tab3Page
+ children: [
+ {
+ path: '',
+ loadChildren: '../tab3/tab3.module#Tab3PageModule'
+ }
+ ]
+ },
+ {
+ path: '',
+ redirectTo: '/tabs/tab1',
+ pathMatch: 'full'
}
]
},
{
path: '',
- redirectTo: '/tabs/(tab1:tab1)',
+ redirectTo: '/tabs/tab1',
pathMatch: 'full'
}
];
And for the tabs markup, we have something close to pre-beta 16 tabs, but still provides a custom tab-bar.
<ion-tabs>
- <ion-tab tab="tab1">
- <ion-router-outlet name="tab1"></ion-router-outlet>
- </ion-tab>
- <ion-tab tab="tab2">
- <ion-router-outlet name="tab2"></ion-router-outlet>
- </ion-tab>
- <ion-tab tab="tab3">
- <ion-router-outlet name="tab3"></ion-router-outlet>
- </ion-tab>
-
<ion-tab-bar slot="bottom">
-
- <ion-tab-button tab="tab1" href="/tabs/(tab1:tab1)">
+ <ion-tab-button tab="tab1">
<ion-icon name="flash"></ion-icon>
<ion-label>Tab One</ion-label>
</ion-tab-button>
- <ion-tab-button tab="tab2" href="/tabs/(tab2:tab2)">
+ <ion-tab-button tab="tab2">
<ion-icon name="apps"></ion-icon>
<ion-label>Tab Two</ion-label>
</ion-tab-button>
- <ion-tab-button tab="tab3" href="/tabs/(tab3:tab3)">
+ <ion-tab-button tab="tab3">
<ion-icon name="send"></ion-icon>
<ion-label>Tab Three</ion-label>
</ion-tab-button>
-
</ion-tab-bar>
</ion-tabs>
For consistency sake, the href
attribute of ion-button
, ion-item
and ion-anchor
no longer
trigger navigation using the Angular’s Router,instead use angular’s [routerLink]
:
- <ion-button href="/path/to/page">
+ <ion-button routerLink="/path/to/page">
This change will not affect SEO since ionic will still use href
under the hood.
For consistency with other frameworks and the rest of APIs and tooling, the exported
ionic components are prefixed with Ion
.
- import { Input } from '@ionic/angular';
+ import { IonInput } from '@ionic/angular';
This change might also help to improve autocompletion, and prevent collisions with other libraries.
Published by manucorporat almost 6 years ago
Published by manucorporat almost 6 years ago
Segment Button now requires the text to be wrapped in an ion-label
element for improved styling.
Old usage:
<ion-segment-button>
Item One
</ion-segment-button>
New usage:
<ion-segment-button>
<ion-label>Item One</ion-label>
</ion-segment-button>
Because of updates to the Material Design spec, ion-chip
no longer requires a chip-specific version of ion-icon
or ion-button
. Chips themselves should be interactive and don't require a nested button.
Old usage:
<ion-chip>
<ion-chip-icon name="checkmark"><ion-chip-icon>
</ion-chip>
New usage:
<ion-chip>
<ion-icon name="checkmark"></ion-icon>
</ion-chip>
If you are using @ionic/angular, please update the version number of any @angular packages in your package.json file to 7.0.3
.
"dependencies": {
"@angular/common": "~7.0.3",
"@angular/core": "~7.0.3",
"@angular/forms": "~7.0.3",
"@angular/http": "~7.0.3",
"@angular/platform-browser": "~7.0.3",
"@angular/platform-browser-dynamic": "~7.0.3",
"@angular/router": "~7.0.3",
"rxjs": "6.3.3",
"devDependencies": {
"@angular-devkit/architect": "~0.10.5",
"@angular-devkit/build-angular": "~0.10.5",
"@angular-devkit/core": "~0.7.5",
"@angular-devkit/schematics": "~0.7.5",
"@angular/cli": "~7.0.3",
"@angular/compiler": "~7.0.3",
"@angular/compiler-cli": "~7.0.3",
"@angular/language-service": "~7.0.3",
Published by manucorporat almost 6 years ago
The following global CSS variables have been removed for the reasons listed.
Variable Name | Reason |
---|---|
--ion-toolbar-color-inactive |
Unused |
--ion-ripple-background-color |
Unused / Ripple color is based on component |
--ion-header-size |
Removed in favor of using CSS for h1-h6 |
--ion-header-step |
Removed in favor of using CSS for h1-h6 |
The following global CSS variables have been renamed for the reasons listed.
Old Variable Name | New Variable Name | Reason |
---|---|---|
--ion-toolbar-text-color |
--ion-toolbar-color |
Variable is not limited to text color |
--ion-toolbar-color-active |
--ion-toolbar-color-activated |
Consistency with our component variables |
--ion-tabbar-text-color |
--ion-tab-bar-color |
Variable is not limited to text color |
--ion-tabbar-text-color-active |
--ion-tab-bar-color-activated |
Consistency with our component variables |
--ion-tabbar-background-color |
--ion-tab-bar-background |
Applies to the background property |
--ion-tabbar-background-color-focused |
--ion-tab-bar-background-focused |
Applies to the background property |
--ion-item-background-color |
--ion-item-background |
Applies to the background property |
--ion-item-background-color-active |
--ion-item-background-activated |
Applies to the background property / Consistency with our component variables |
--ion-item-text-color |
--ion-item-color |
Variable is not limited to text color |
--ion-placeholder-text-color |
--ion-placeholder-color |
Consistency with other variables |
One of the most valuable and complex components in Ionic's toolkit is Tabs. Tabs started off as a simple component that would create a tabbed interface to allow users to switch between different views in a way that was consistent with native UX paradigms.
Over time, we started hearing people ask for more features to be added: "Can we have one tab button that is just a button?" "Can I customize how the tab buttons are displayed?" "Can I use a custom icon in the tab?"
Traditionally, these features, and many others, were difficult to accomplish because Tabs was doing a lot of magic behind the scenes to generate the Tab bar and buttons. With this in mind, we thought it was time for a refresh to offer as much flexibility as possible within Tabs.
In order to do this, we had to change how Tabs were written in an app. Prior to Beta 14, Tabs would look like this:
<ion-tabs>
<ion-tab label="Home" icon="home" href="/tabs/(home:home)">
<ion-router-outlet name="home"></ion-router-outlet>
</ion-tab>
<ion-tab label="About" icon="information-circle" href="/tabs/(about:about)">
<ion-router-outlet name="about"></ion-router-outlet>
</ion-tab>
<ion-tab label="Contact" icon="contacts" href="/tabs/(contact:contact)">
<ion-router-outlet name="contact"></ion-router-outlet>
</ion-tab>
</ion-tabs>
Here, we have an ion-tab
element that accepts an icon, a label, and a link to navigate to as properties. This is pretty much how Tabs have worked all the way back to Ionic 1. In Beta 14, we've removed some of the magic from Tabs which allows for more customization:
<ion-tabs>
<ion-tab-bar>
<!-- No ion-tab, just a link that looks like a tab -->
<ion-tab-button href=”https://beta.ionicframework.com”>
<!-- <a href=”https://beta.ionicframework.com”> -->
<ion-icon name="globe"></ion-icon>
<ion-label>Schedule</ion-label>
</ion-tab-button>
<!-- No ion-tab, just a button that looks like a tab -->
<ion-tab-button (click)=”openCamera()”>
<ion-icon name="camera"></ion-icon>
<ion-label>Photo</ion-label>
</ion-tab-button>
<!-- Connected to ion-tab, on click will show the ion-tab with id home-view -->
<ion-tab-button tab=”home-view”>
<ion-icon name="home"></ion-icon>
<ion-label>Home</ion-label>
</ion-tab-button>
</ion-tab-bar>
<ion-tab tab=”home-view”>
<ion-content></ion-content>
<!-- or -->
<ion-nav></ion-nav>
<!-- or -->
<ion-router-outlet></ion-router-outlet>
</ion-tab>
</ion-tabs>
There's a lot going on here, so let's break it down:
ion-tabs
wraps the entire layout. Same as before.ion-tab-bar
, creates the Tab Bar which will contain buttons.ion-tab-button
, is used to create each button in the Tab Bar. These could be static links to different routes, buttons with click handlers on them, or link to whole tab views.ion-tab
component becomes a separate container that has inline content (ion-content
), a navigation component (ion-nav
) or a router outlet (ion-router-outlet
).To connect the ion-tab-button
to the ion-tab
, the tab
property must be added to both of these components. For example:
<ion-tabs>
<ion-tab-bar>
<ion-tab-button tab=”home-view”></ion-tab-button>
</ion-tab-bar>
<ion-tab tab=”home-view”></ion-tab>
</ion-tabs>
Since the tab
property is the same on the ion-tab-button
and ion-tab
, when the Tab Button is tapped, the home-view
Tab will become active. This takes the magic out of Tabs while making the behavior between the tab buttons and the views much more explicit.
Some other benefits of this refactor include:
Lastly, this change also fixes some outstanding issues with Tabs, so we're excited to get this out to you all!
Published by manucorporat almost 6 years ago
One of the most valuable and complex components in Ionic's toolkit is Tabs. Tabs started off as a simple component that would create a tabbed interface to allow users to switch between different views in a way that was consistent with native UX paradigms.
Over time, we started hearing people ask for more features to be added: "Can we have one tab button that is just a button?" "Can I customize how the tab buttons are displayed?" "Can I use a custom icon in the tab?"
Traditionally, these features, and many others, were difficult to accomplish because Tabs was doing a lot of magic behind the scenes to generate the Tab bar and buttons. With this in mind, we thought it was time for a refresh to offer as much flexibility as possible within Tabs.
In order to do this, we had to change how Tabs were written in an app. Prior to Beta 14, Tabs would look like this:
<ion-tabs>
<ion-tab label="Home" icon="home" href="/tabs/(home:home)">
<ion-router-outlet name="home"></ion-router-outlet>
</ion-tab>
<ion-tab label="About" icon="information-circle" href="/tabs/(about:about)">
<ion-router-outlet name="about"></ion-router-outlet>
</ion-tab>
<ion-tab label="Contact" icon="contacts" href="/tabs/(contact:contact)">
<ion-router-outlet name="contact"></ion-router-outlet>
</ion-tab>
</ion-tabs>
Here, we have an ion-tab
element that accepts an icon, a label, and a link to navigate to as properties. This is pretty much how Tabs have worked all the way back to Ionic 1. In Beta 14, we've removed some of the magic from Tabs which allows for more customization:
<ion-tabs>
<ion-tab-bar>
<!-- No ion-tab, just a link that looks like a tab -->
<ion-tab-button href=”https://beta.ionicframework.com”>
<!-- <a href=”https://beta.ionicframework.com”> -->
<ion-icon name="globe"></ion-icon>
<ion-label>Schedule</ion-label>
</ion-tab-button>
<!-- No ion-tab, just a button that looks like a tab -->
<ion-tab-button (click)=”openCamera()”>
<ion-icon name="camera"></ion-icon>
<ion-label>Photo</ion-label>
</ion-tab-button>
<!-- Connected to ion-tab, on click will show the ion-tab with id home-view -->
<ion-tab-button tab=”home-view”>
<ion-icon name="home"></ion-icon>
<ion-label>Home</ion-label>
</ion-tab-button>
</ion-tab-bar>
<ion-tab tab=”home-view”>
<ion-content></ion-content>
<!-- or -->
<ion-nav></ion-nav>
<!-- or -->
<ion-router-outlet></ion-router-outlet>
</ion-tab>
</ion-tabs>
There's a lot going on here, so let's break it down:
ion-tabs
wraps the entire layout. Same as before.ion-tab-bar
, creates the Tab Bar which will contain buttons.ion-tab-button
, is used to create each button in the Tab Bar. These could be static links to different routes, buttons with click handlers on them, or link to whole tab views.ion-tab
component becomes a separate container that has inline content (ion-content
), a navigation component (ion-nav
) or a router outlet (ion-router-outlet
).To connect the ion-tab-button
to the ion-tab
, the tab
property must be added to both of these components. For example:
<ion-tabs>
<ion-tab-bar>
<ion-tab-button tab=”home-view”></ion-tab-button>
</ion-tab-bar>
<ion-tab tab=”home-view”></ion-tab>
</ion-tabs>
Since the tab
property is the same on the ion-tab-button
and ion-tab
, when the Tab Button is tapped, the home-view
Tab will become active. This takes the magic out of Tabs while making the behavior between the tab buttons and the views much more explicit.
Some other benefits of this refactor include:
Lastly, this change also fixes some outstanding issues with Tabs, so we're excited to get this out to you all!
Published by manucorporat almost 6 years ago
One of the most valuable and complex components in Ionic's toolkit is Tabs. Tabs started off as a simple component that would create a tabbed interface to allow users to switch between different views in a way that was consistent with native UX paradigms.
Over time, we started hearing people ask for more features to be added: "Can we have one tab button that is just a button?" "Can I customize how the tab buttons are displayed?" "Can I use a custom icon in the tab?"
Traditionally, these features, and many others, were difficult to accomplish because Tabs was doing a lot of magic behind the scenes to generate the Tab bar and buttons. With this in mind, we thought it was time for a refresh to offer as much flexibility as possible within Tabs.
In order to do this, we had to change how Tabs were written in an app. Prior to Beta 14, Tabs would look like this:
<ion-tabs>
<ion-tab label="Home" icon="home" href="/tabs/(home:home)">
<ion-router-outlet name="home"></ion-router-outlet>
</ion-tab>
<ion-tab label="About" icon="information-circle" href="/tabs/(about:about)">
<ion-router-outlet name="about"></ion-router-outlet>
</ion-tab>
<ion-tab label="Contact" icon="contacts" href="/tabs/(contact:contact)">
<ion-router-outlet name="contact"></ion-router-outlet>
</ion-tab>
</ion-tabs>
Here, we have an ion-tab
element that accepts an icon, a label, and a link to navigate to as properties. This is pretty much how Tabs have worked all the way back to Ionic 1. In Beta 14, we've removed some of the magic from Tabs which allows for more customization:
<ion-tabs>
<ion-tab-bar>
<!-- No ion-tab, just a link that looks like a tab -->
<ion-tab-button href=”https://beta.ionicframework.com”>
<!-- <a href=”https://beta.ionicframework.com”> -->
<ion-icon name="globe"></ion-icon>
<ion-label>Schedule</ion-label>
</ion-tab-button>
<!-- No ion-tab, just a button that looks like a tab -->
<ion-tab-button (click)=”openCamera()”>
<ion-icon name="camera"></ion-icon>
<ion-label>Photo</ion-label>
</ion-tab-button>
<!-- Connected to ion-tab, on click will show the ion-tab with id home-view -->
<ion-tab-button tab=”home-view”>
<ion-icon name="home"></ion-icon>
<ion-label>Home</ion-label>
</ion-tab-button>
</ion-tab-bar>
<ion-tab tab=”home-view”>
<ion-content></ion-content>
<!-- or -->
<ion-nav></ion-nav>
<!-- or -->
<ion-router-outlet></ion-router-outlet>
</ion-tab>
</ion-tabs>
There's a lot going on here, so let's break it down:
ion-tabs
wraps the entire layout. Same as before.ion-tab-bar
, creates the Tab Bar which will contain buttons.ion-tab-button
, is used to create each button in the Tab Bar. These could be static links to different routes, buttons with click handlers on them, or link to whole tab views.ion-tab
component becomes a separate container that has inline content (ion-content
), a navigation component (ion-nav
) or a router outlet (ion-router-outlet
).To connect the ion-tab-button
to the ion-tab
, the tab
property must be added to both of these components. For example:
<ion-tabs>
<ion-tab-bar>
<ion-tab-button tab=”home-view”></ion-tab-button>
</ion-tab-bar>
<ion-tab tab=”home-view”></ion-tab>
</ion-tabs>
Since the tab
property is the same on the ion-tab-button
and ion-tab
, when the Tab Button is tapped, the home-view
Tab will become active. This takes the magic out of Tabs while making the behavior between the tab buttons and the views much more explicit.
Some other benefits of this refactor include:
Lastly, this change also fixes some outstanding issues with Tabs, so we're excited to get this out to you all!
Published by manucorporat about 6 years ago
Published by manucorporat about 6 years ago
Published by manucorporat about 6 years ago