ionic-framework
A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
Top Related Projects
A framework for building native applications using React
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
Remote Administration Tool for Windows
Full featured HTML framework for building iOS & Android apps
Quick Overview
Ionic Framework is an open-source UI toolkit for building high-quality mobile and desktop apps using web technologies (HTML, CSS, and JavaScript). It focuses on the frontend user experience and integrates easily with popular frameworks like Angular, React, and Vue.
Pros
- Cross-platform development: Build once, deploy to multiple platforms (iOS, Android, web)
- Rich set of pre-built UI components and native-like animations
- Strong community support and extensive documentation
- Regular updates and improvements
Cons
- Performance may not match fully native apps for complex applications
- Learning curve for developers new to web technologies or hybrid app development
- Dependency on Cordova/Capacitor for accessing native device features
- Limited customization options for some built-in components
Code Examples
- Creating a basic Ionic page with a header and content:
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react';
const Home: React.FC = () => {
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonTitle>Home</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent className="ion-padding">
<h1>Welcome to Ionic</h1>
</IonContent>
</IonPage>
);
};
export default Home;
- Using Ionic's form components:
import { IonContent, IonInput, IonItem, IonLabel, IonList } from '@ionic/react';
const Form: React.FC = () => {
return (
<IonContent>
<IonList>
<IonItem>
<IonLabel position="floating">Name</IonLabel>
<IonInput></IonInput>
</IonItem>
<IonItem>
<IonLabel position="floating">Email</IonLabel>
<IonInput type="email"></IonInput>
</IonItem>
</IonList>
</IonContent>
);
};
- Implementing a modal dialog:
import { IonButton, IonContent, IonModal } from '@ionic/react';
import { useState } from 'react';
const ModalExample: React.FC = () => {
const [isOpen, setIsOpen] = useState(false);
return (
<IonContent>
<IonButton onClick={() => setIsOpen(true)}>Open Modal</IonButton>
<IonModal isOpen={isOpen}>
<IonContent className="ion-padding">
<h1>Modal Content</h1>
<IonButton onClick={() => setIsOpen(false)}>Close Modal</IonButton>
</IonContent>
</IonModal>
</IonContent>
);
};
Getting Started
To start a new Ionic React project:
-
Install Ionic CLI:
npm install -g @ionic/cli
-
Create a new project:
ionic start myApp blank --type=react cd myApp
-
Run the development server:
ionic serve
This will create a new Ionic React project and start a development server. You can now begin building your app by editing the files in the src
directory.
Competitor Comparisons
A framework for building native applications using React
Pros of React Native
- Native performance: React Native compiles to native code, offering better performance for complex apps
- Larger ecosystem: More third-party libraries and components available
- Hot reloading: Faster development with instant updates to the app during coding
Cons of React Native
- Steeper learning curve: Requires knowledge of React and native mobile development concepts
- Platform-specific code: Some features may require separate iOS and Android implementations
- Larger app size: React Native apps tend to be larger than Ionic apps
Code Comparison
React Native:
import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
const App = () => (
<View style={styles.container}>
<Text>Hello, React Native!</Text>
</View>
);
Ionic:
<ion-content>
<ion-card>
<ion-card-header>
<ion-card-title>Hello, Ionic!</ion-card-title>
</ion-card-header>
</ion-card>
</ion-content>
React Native uses JSX syntax and React components, while Ionic leverages web technologies and custom HTML elements. React Native provides a more native look and feel, whereas Ionic offers a consistent cross-platform UI with web-based components. Both frameworks have their strengths, with React Native excelling in performance-critical apps and Ionic offering faster development for simpler applications.
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
Pros of Flutter
- Native performance with a single codebase for multiple platforms
- Rich set of pre-designed widgets for faster UI development
- Hot reload feature for quick iterations and debugging
Cons of Flutter
- Larger app size due to bundled runtime and components
- Steeper learning curve for developers new to Dart language
- Limited access to platform-specific APIs compared to Ionic
Code Comparison
Flutter:
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Flutter App')),
body: Center(child: Text('Hello, World!')),
),
));
}
Ionic:
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<ion-app>
<ion-header>
<ion-toolbar>
<ion-title>Ionic App</ion-title>
</ion-toolbar>
</ion-header>
<ion-content class="ion-padding">
Hello, World!
</ion-content>
</ion-app>
`
})
export class AppComponent {}
Flutter uses Dart and provides a more concise way to create UI components, while Ionic leverages web technologies and Angular for a familiar web development experience. Flutter's approach results in a more native look and feel, whereas Ionic's web-based approach offers greater flexibility in terms of customization and platform compatibility.
⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
Pros of NativeScript
- True native performance with direct access to native APIs
- Ability to use existing native libraries and plugins
- Supports both Angular and Vue.js frameworks
Cons of NativeScript
- Steeper learning curve, especially for developers new to mobile development
- Smaller community and ecosystem compared to Ionic
- Limited UI components out of the box, may require more custom development
Code Comparison
NativeScript (XML):
<StackLayout>
<Label text="Hello, NativeScript!" />
<Button text="Click Me" tap="onButtonTap" />
</StackLayout>
Ionic (HTML):
<ion-content>
<ion-text>Hello, Ionic!</ion-text>
<ion-button (click)="onButtonClick()">Click Me</ion-button>
</ion-content>
NativeScript uses XML-based markup for defining UI components, while Ionic uses HTML with Angular-like syntax. NativeScript's approach is closer to native mobile development, whereas Ionic's syntax is more familiar to web developers.
Both frameworks offer powerful tools for cross-platform mobile development, but they cater to different developer preferences and project requirements. NativeScript excels in native performance and access to platform-specific APIs, while Ionic shines in its ease of use and extensive ecosystem for web developers transitioning to mobile development.
Remote Administration Tool for Windows
Pros of Quasar
- Faster performance and smaller bundle sizes
- More comprehensive UI component library out-of-the-box
- Better support for desktop application development (Electron)
Cons of Quasar
- Smaller community and ecosystem compared to Ionic
- Less extensive documentation and learning resources
- Fewer third-party plugins and integrations available
Code Comparison
Quasar component example:
<template>
<q-btn color="primary" label="Click me" @click="handleClick" />
</template>
Ionic component example:
import { IonButton } from '@ionic/react';
const MyComponent = () => (
<IonButton color="primary" onClick={handleClick}>Click me</IonButton>
);
Both frameworks offer similar component-based structures, but Quasar's Vue-based approach may be more familiar to Vue developers, while Ionic's React components align well with React developers. Quasar's syntax is often more concise, but Ionic's approach may be more flexible for complex scenarios.
Quasar excels in performance and comprehensive UI components, making it attractive for developers who prioritize these aspects. However, Ionic's larger community and extensive ecosystem provide better long-term support and resources for developers, especially those working on mobile-first applications.
Full featured HTML framework for building iOS & Android apps
Pros of Framework7
- Lighter weight and faster performance
- More flexible, can be used with any JavaScript framework
- Closer to native look and feel on iOS and Android
Cons of Framework7
- Smaller community and ecosystem compared to Ionic
- Less comprehensive documentation and learning resources
- Fewer built-in components and plugins
Code Comparison
Ionic (Angular):
import { Component } from '@angular/core';
import { IonicModule } from '@ionic/angular';
@Component({
selector: 'app-home',
template: '<ion-button>Click me</ion-button>',
standalone: true,
imports: [IonicModule],
})
export class HomePage {}
Framework7 (Vanilla JS):
var app = new Framework7({
el: '#app',
routes: [
{ path: '/', component: HomePage },
],
});
function HomePage() {
return '<a class="button">Click me</a>';
}
Both frameworks offer easy-to-use component systems, but Ionic is more tightly integrated with Angular (though it supports other frameworks), while Framework7 provides a more vanilla JavaScript approach. Ionic's ecosystem and tooling are more extensive, making it easier for large-scale applications. Framework7, on the other hand, offers a lighter footprint and more flexibility in terms of framework choice.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
Ionic
Ionic is an open source app development toolkit for building modern, fast, top-quality cross-platform native and Progressive Web Apps from a single codebase with JavaScript and the Web.
Ionic is based on Web Components, which enables significant performance, usability, and feature improvements alongside support for popular web frameworks like Angular, React, and Vue.
Quickstart
·
Documentation
·
Contribute
·
Blog
Community:
Discord
·
Forums
·
Twitter
Packages
Project | Package | Version | Downloads | Links |
---|---|---|---|---|
Core | @ionic/core | README.md | ||
Angular | @ionic/angular | README.md | ||
Vue | @ionic/vue | README.md | ||
React | @ionic/react | README.md |
Looking for the ionic-angular
package? Ionic 3 has been moved to the ionic-v3
repo. See Earlier Versions.
Getting Started
Start a new project by following our documentation. We would love to hear from you! If you have any feedback or run into issues using our framework, please file an issue on this repository.
Migration Guides
Already have an Ionic app? These guides will help you migrate to the latest versions.
- Migrate from v7 to v8
- Migrate from v6 to v7
- Migrate from v5 to v6
- Migrate from v4 to v5
- Migrate from v3 to v4
Examples
The Ionic Conference App is a full featured Ionic app. It is the perfect starting point for learning and building your own app.
Contributing
Thanks for your interest in contributing! Read up on our guidelines for contributing and then look through our issues with a help wanted label.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Earlier Versions
The source code for earlier versions of the Ionic Framework may exist in other repositories. Please open issues and pull requests in their respective repositories.
- Ionic 2/3: Moved to
ionic-team/ionic-v3
- Ionic 1: Moved to
ionic-team/ionic-v1
Top Related Projects
A framework for building native applications using React
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
Remote Administration Tool for Windows
Full featured HTML framework for building iOS & Android apps
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot