Ionic 7 is here!
Today, we are excited to announce the release of Ionic 7! This stable release of Ionic comes after several betas and release candidates with improvements suggested by the Ionic community. Thanks to all of your contributions and the hard work of our team, we’re thrilled to officially bring Ionic 7 to market.
Here’s what’s new in Ionic 7:
In Ionic 6 we introduced the ability to use the Modal and Popover components declaratively inside application templates. We’ve now added this functionality to the Action Sheet, Alert, Loading, Picker, and Toast components. This addition means developers can pass data as properties on the component instance without using a controller. We have also added
trigger properties to reduce the amount of code required to present and dismiss these overlays.
<ion-button id=”open-loading”>Open Loading</ion-button> <ion-loading trigger=”open-loading” message=”Loading…”></ion-loading>
The playgrounds for each example have been updated to showcase this new usage:
Consistent Events Emissions
In Ionic 6, the
ionChange event fired every time the
value property on components changed. This behavior caused the
ionChange event to fire at unexpected times. We revised the
ionChange event to only fire from user-generated interactions such as taps or clicks. This behavior aligns more closely with the behavior found in native
Developers can continue to use the
ionInput event in components such as Input or Textarea to detect every keypress from the user.
Developers do not need to make any changes to get this improvement; however, we recommend that developers evaluate their applications when updating to Ionic 7.
Simplified Form Control Syntax
Ionic 7 introduces a streamlined way of working with form controls such as Toggle or Input. The Item and Label components are no longer required, and each form control handles the label content directly. Additionally, certain features such as helper text or input fill modes have moved from
ion-item to the appropriate form controls such as
This change has several improvements:
- Reduces code boilerplate by removing the
- Improves compatibility with assistive technologies by ensuring the form control is associated with a label.
- Enhances the developer experience by clarifying the intent of form component APIs.
<ion-item fill=”outline”> <ion-label>Email:</ion-label> <ion-input placeholder=”firstname.lastname@example.org”></ion-input> <div slot=”helper”>Please enter a valid email address</div> </ion-item>
<ion-input label=”Email:” placeholder=”email@example.com” fill=”outline” helper-text=”Please enter a valid email address” ></ion-input>
These changes have been added in a backward-compatible way meaning developers do not need to migrate to this new syntax to upgrade to Ionic 7. Developers are also able to migrate these components one at a time. The documentation for each form component has been updated with new playgrounds and migration guides:
Ionic 7 significantly improves the performance of Tabs. In Ionic React and Ionic Vue, developers can expect a performance improvement of up to 70% when switching tabs.
Ionic Angular developers can expect improved Ionic component initialization times thanks to optimizations in Stencil!
Improved Vite Compatibility
Ionic 7 removes the Common JS entry points for Ionic React and Ionic Vue to make each package easier to use with Vite and Vitest.
ion-slide components have been removed in favor of using Swiper.js directly. This change gives developers access to the latest version of Swiper, including all the great features this library has to offer.
The Ionic Docs have been updated with the latest usage examples: https://ionicframework.com/docs
We have also added a new “Upgrade Guides” section in the sidebar for developers updating from older versions of Ionic.
Starter Applications Tooling
With the release of the new Ionic CLI v7, all new Ionic React and Ionic Vue starter applications will use Vite. This tooling replaces the Vue CLI and Create React App tools used in previous starter applications. Since this change only impacts new Ionic apps created with Ionic CLI v7, developers can continue to use the Vue CLI and Create React App tools in their existing Ionic apps.
Be on the lookout for a blog post with more information about Ionic CLI v7 soon!
Developers can follow the Ionic 7 Migration Guide to update their existing Ionic 6 apps.
Looking to start with a brand new Ionic 7 app? Try our app creation wizard!
Please report any issues you encounter on our GitHub repo.
Thank you to everyone who tested or provided feedback during the Ionic 7 beta process. Thanks to you, we have a great product that’s sure to make development easier than ever. Stay tuned, as we have many more great improvements planned for Ionic in 2023!