Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 37 ยท Getting Started

Choosing Angular, React or Vue for Ionic

Compare Ionic with Angular, React and Vue side by side: the same page, component, state and event code in each, plus a clear way to choose.

Ionic runs on top of three major frameworks, and it also works with plain JavaScript. The UI components and the platform behaviour are the same everywhere; what changes is the language you use for templates, state and routing. This lesson shows the same screen in all three flavours so you can see the differences, then gives you a practical way to choose.

What stays the same

Whichever flavour you choose, you get:

  • the same 100+ Ionic components and the same theming variables;
  • the same ios and md modes and the same Capacitor plugins;
  • the same layout (ion-page, header, toolbar, content);
  • the same build output: static HTML, CSS and JavaScript files.

Only the binding layer differs: @ionic/angular, @ionic/react or @ionic/vue. Each wraps the Web Components so they feel natural: property binding in Angular, props in React, v-model and events in Vue.

The same counter screen three times

A page with a title, a counter, and a button that adds one. The code is read-only because the real frameworks are not available on this site.

Angular (standalone component):

TypeScript
import { Component } from '@angular/core';
import {
  IonHeader, IonToolbar, IonTitle, IonContent, IonButton,
} from '@ionic/angular/standalone';

@Component({
  selector: 'app-counter',
  standalone: true,
  imports: [IonHeader, IonToolbar, IonTitle, IonContent, IonButton],
  template: `
    <ion-header>
      <ion-toolbar><ion-title>Counter</ion-title></ion-toolbar>
    </ion-header>
    <ion-content class="ion-padding">
      <p>Count: {{ count }}</p>
      <ion-button (click)="count = count + 1">Add one</ion-button>
    </ion-content>
  `,
})
export class CounterPage {
  count = 0;
}

React (function component with hooks):

JSX
import { useState } from 'react';
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton } from '@ionic/react';

export default function CounterPage() {
  const [count, setCount] = useState(0);
  return (
    <IonPage>
      <IonHeader>
        <IonToolbar><IonTitle>Counter</IonTitle></IonToolbar>
      </IonHeader>
      <IonContent className="ion-padding">
        <p>Count: {count}</p>
        <IonButton onClick={() => setCount(count + 1)}>Add one</IonButton>
      </IonContent>
    </IonPage>
  );
}

Vue (script setup):

HTML
<template>
  <ion-page>
    <ion-header>
      <ion-toolbar><ion-title>Counter</ion-title></ion-toolbar>
    </ion-header>
    <ion-content class="ion-padding">
      <p>Count: {{ count }}</p>
      <ion-button @click="count++">Add one</ion-button>
    </ion-content>
  </ion-page>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButton } from '@ionic/vue';
const count = ref(0);
</script>

Notice that the Ionic tags are the same in each. Only the way you hold and update count changes.

Stand-in: one state, three update styles

The three frameworks handle state differently. This stand-in is plain JavaScript that mimics the three approaches so you can compare them: mutate a field and re-render (Angular zone-style), replace immutable state (React), and wrap a value in a reactive container (Vue refs). It is not real framework code.

JS Stand-in: three ways to update state

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Strengths of each flavour

Angular React Vue
Style Full framework, opinionated Library, you assemble the rest Progressive framework
Language TypeScript required JS or TS with JSX JS or TS, single-file components
Built-in tools Router, forms, HTTP, DI Add router, forms, state yourself Router and Pinia are official
Ionic integration Oldest, most generators Uses React Router v5 under the hood Uses Vue Router
Good when Large teams, enterprise apps You already use React Fast learning curve

A short summary of the router situation: Ionic React uses React Router v5, wrapped as IonReactRouter. That is intentional: Ionic needs the stack-based page model of v5. You will see this in routing basics.

Using Ionic without a framework

You can load Ionic from a script tag or via npm and use the Web Components directly. This is useful for small projects, or for adding Ionic components to an existing site:

HTML
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core/dist/ionic/ionic.esm.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core/css/ionic.bundle.css" />

You lose framework routing, so you would handle navigation yourself with ion-nav or a plain router. For real apps most teams pick a framework.

A decision guide

flowchart TD
  A["Does your team already know a framework?"] -->|Yes| B["Use that one"]
  A -->|No| C["Need a full toolbox with strict structure?"]
  C -->|Yes| D["Angular"]
  C -->|No| E["Prefer JSX or templates?"]
  E -->|JSX| F["React"]
  E -->|Templates| G["Vue"]

Experience beats features: the best flavour is the one your team can already write fluently.

Because the Ionic layer is identical, you are not locking in forever. Switching framework later means rewriting pages, but the theme, CSS and Capacitor setup carry over.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What differs between Ionic flavours?

    Components, theming and native plugins are shared; the framework's syntax for state, templates and routing differs.
  2. 2. Which router does Ionic React use under the hood?

    IonReactRouter wraps React Router v5, whose model fits Ionic's page stack.
  3. 3. Which flavour requires TypeScript?

    Angular projects are written in TypeScript.
  4. 4. What is the best way to choose a flavour?

    Since Ionic is identical across flavours, existing skills decide.

Summary

  • Ionic works with Angular, React, Vue or plain Web Components.
  • Components, themes and Capacitor are the same in every flavour.
  • Angular is the most structured, React the most flexible, Vue the gentlest.
  • Ionic React uses React Router v5 on purpose.
  • Choose the framework your team already knows.

Next: Web Components and Shadow DOM