Skip to content
Tutorials Center
My learning

Topics

Lesson 1 of 37 ยท Getting Started

What Is Ionic Framework?

Learn what Ionic Framework is, how it builds iOS, Android and web apps from one codebase with web technologies, and when it is the right choice.

Ionic is an open-source UI toolkit for building mobile and desktop-class apps with web technologies: HTML, CSS and JavaScript or TypeScript. You write one codebase and ship it as a website, a Progressive Web App (PWA), an iOS app and an Android app. Ionic itself gives you the interface layer: buttons, lists, tabs, modals, navigation transitions and a theming system that looks native on every platform.

Ionic is not a framework in the "replace React" sense. It sits next to the framework you already like. You can use it with Angular, React or Vue, or with no framework at all. Native features such as the camera or the file system come from a companion tool called Capacitor, which you will meet in chapter 5. This lesson explains the pieces and how they fit together.

The three layers of an Ionic app

An Ionic app is a stack of three layers, each with one job.

Three layers

Ionic UI Components and themes
Your framework Angular, React or Vue
Capacitor Native shell and APIs

Ionic draws, your framework thinks, Capacitor talks to the phone.

1 / 2
  1. Ionic UI components. More than 100 custom elements such as <ion-button>, <ion-list> and <ion-modal>. They are built as standard Web Components, so they work in any framework.
  2. Your JavaScript framework. It handles routing, state and your own components. Ionic ships thin bindings (@ionic/angular, @ionic/react, @ionic/vue) that make the components feel idiomatic there.
  3. Capacitor. A runtime that wraps your built web app in a native iOS or Android project and exposes native APIs to JavaScript.
flowchart TD
  A["Your code (HTML, CSS, TypeScript)"] --> B["Ionic components + framework"]
  B --> C["vite or webpack build: static files"]
  C --> D["Browser or PWA"]
  C --> E["Capacitor: iOS WebView"]
  C --> F["Capacitor: Android WebView"]

From source to three targets: the build produces static files and every target loads those same files.

What the code looks like

A minimal Ionic page in plain HTML, with no framework, looks like this. This is read-only because the real Ionic bundle is not loaded on this site.

HTML
<ion-app>
  <ion-header>
    <ion-toolbar color="primary">
      <ion-title>Hello Ionic</ion-title>
    </ion-toolbar>
  </ion-header>
  <ion-content class="ion-padding">
    <ion-button expand="block" id="greet">Say hello</ion-button>
    <p id="out"></p>
  </ion-content>
</ion-app>

The structure is always the same: an ion-app root, a header with a toolbar, and an ion-content area that scrolls. Every screen in your app follows this skeleton, which you will build properly in your first app.

How the app runs on a phone

Capacitor creates a native project. Its only visible element is a WebView, a browser surface without the browser chrome (address bar, tabs). Your built files load inside it. When the page calls a native API, Capacitor passes the call across a bridge to native code and returns the result.

That model has trade-offs worth knowing before you commit:

Strength Cost
One codebase for web, iOS and Android Not as fast as fully native for heavy graphics
Your existing web skills apply directly Very new OS features may need a plugin first
Fast iteration in the browser with live reload App size includes a WebView host
Free, open source, large plugin ecosystem You must still test on real devices

For forms, lists, dashboards, content apps, field tools, e-commerce and internal business apps, this trade-off is usually excellent. For 3D games or apps built around real-time camera filters, a native or game engine approach fits better.

A stand-in: components as plain data

You cannot run the real Ionic here, but the core idea is easy to imitate: a screen is a tree of components, and a platform "mode" decides how each one looks. The next block is a stand-in written in plain JavaScript. It is not Ionic code; it only shows the principle that the same description renders differently per platform.

JS Stand-in: one description, two platform styles

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

No output.

Real Ionic does the same thing with CSS: each component has an ios and an md (Material Design) style, picked automatically from the device.

Ionic and the web platform

Because Ionic is made of Web Components, a few useful facts follow:

  • You can inspect <ion-button> in the browser developer tools like any element.
  • Components expose CSS custom properties and CSS shadow parts for styling (see theming with CSS variables).
  • Events are normal DOM events with an ion prefix, such as ionChange and ionInput.
  • Properties go through attributes or properties, so any framework can set them.

Here is a tiny stand-in for the event idea. It runs because Node and browsers share EventTarget.

JS Stand-in: ionChange as a custom event

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

No output.

Where Ionic fits among other options

  • Native (Swift, Kotlin): best raw performance and day-one access to new APIs, but two separate codebases.
  • React Native, Flutter: one codebase, native or custom-drawn widgets; a different programming model than the web.
  • Ionic: web skills, web deployment included, the widest reuse of existing web code.

Choose Ionic when your team knows the web, you need a website and apps from one codebase, or your app is mostly screens, forms and data.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does Capacitor do in an Ionic app?

    Capacitor provides the native iOS/Android project with a WebView and a bridge to native APIs. Ionic UI draws the interface.
  2. 2. Which technology are Ionic components built on?

    Ionic components are standard custom elements, so they work in any framework or in plain HTML.
  3. 3. Which of these is a realistic downside of the Ionic approach?

    A WebView app is great for UI-centred apps, but graphics-heavy apps are a poor fit.
  4. 4. Which events does Ionic emit from form controls?

    Ionic controls dispatch DOM events like ionChange and ionInput.

Summary

  • Ionic is a UI toolkit of Web Components for building web, iOS and Android apps from one codebase.
  • It works with Angular, React, Vue or no framework.
  • Capacitor wraps the built app in a native WebView project and provides native APIs.
  • Each component adapts to the platform with ios and md modes.
  • It is ideal for UI and data apps, and a weaker fit for graphics-heavy apps.

Next: Your First Ionic App with the CLI