/ionic-core:ionic-expertfrom ionic-core
Comprehensive reference for Ionic Framework development covering core concepts, components, theming, lifecycle, navigation, and framework-specific patterns for Angular, React, and Vue. Includes MCP server integration for up-to-date documentation.
Ships in ionic-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Comprehensive reference for Ionic Framework development — core concepts, components, theming, lifecycle, navigation, framework-specific patterns (Angular, React, Vue), upgrading, and Capawesome Cloud integration. This file is an overview. Each section names the skill that holds the exact procedure. Read that skill before changing a project.
Two hosted MCP servers serve the current documentation, so both are always ahead of the guidance bundled with this skill:
Both expose search_docs and get_doc_page, so pick the server by topic before calling either.
search_docs on the server that owns the topic and read the matching page with get_doc_page before applying the guidance below. Pass the version (v9 or v8) that matches the project. Where the two disagree, follow the documentation.claude mcp add --transport http capawesome "https://mcp.capawesome.io/mcp"
claude mcp add --transport http ionic-framework "https://ionic-framework-mcp.capawesome.io/mcp"
Neither server needs an account or a token for documentation. See the capawesome-mcp and ionic-framework-mcp skills for full setup, including the Capawesome Cloud tools.
Ionic Framework is a UI toolkit for building cross-platform apps with web technologies. It provides more than 90 pre-built UI components as Web Components prefixed with ion- (e.g., <ion-button>, <ion-content>).
ios mode; Android and all other platforms use md (Material Design). The <html> element receives a class (ios or md).capacitor-app-development skill for Capacitor guidance.@ionic/angular), React (@ionic/react), and Vue (@ionic/vue).Ionic 9 is the current major version. Ionic 8 projects are still common. Always detect the version first: read the major version of @ionic/angular, @ionic/react, @ionic/vue or @ionic/core in package.json. Several import paths and APIs differ between 8 and 9, and code for the wrong version does not compile.
Requirements of Ionic 9:
| Area | Ionic 9 |
|---|---|
| Angular | 18 through 22. Angular 16 and 17 are no longer supported. |
| React | 18 or 19 with React Router 6 (6.4.0 or later in the 6 line, React Router 7 is not supported) |
| Vue | 3.5+ with Vue Router 5 |
| TypeScript | 5.4 or later |
| Capacitor | 7 and later |
| Browsers | Chrome 89+, Firefox 75+, Edge 89+, Safari 16+, iOS 16+ |
Differences that change the code an agent writes:
| Topic | Ionic 8 | Ionic 9 |
|---|---|---|
| Angular standalone imports | @ionic/angular/standalone | @ionic/angular |
Angular lazy (NgModule) imports, IonicModule | @ionic/angular | @ionic/angular/lazy. IonicModule is deprecated. |
| React routes | <Route path="/home" component={Home} exact /> | <Route path="/home" element={<Home />} /> |
| React redirects | <Redirect to="/home" /> | <Navigate to="/home" replace /> |
| React nested routes | path="/tabs" | path="/tabs/*" |
React useIonPicker, pickerController, ion-picker-legacy | Available | Removed. Use ion-picker inside an ion-modal. |
ion-img | Available | Deprecated. Use <img loading="lazy" decoding="async">. |
autocorrect on ion-input and ion-searchbar | 'on' | 'off' | boolean. autocorrect="off" now turns it on. |
handleBehavior of a sheet ion-modal | Default "none" | Default "cycle" |
ionChange of ion-select | Fires on every confirmation with alert and action-sheet | Fires only when the value changes |
| Swipe back per outlet | swipeBackEnabled config | swipeGesture property on ion-router-outlet |
For the full list, see https://ionicframework.com/docs/updating/9-0.
npm install -g @ionic/cli
ionic start <name> <template> --type=<framework> --capacitor --package-id=<id> --no-interactive
Pass the name, the template, --type and --no-interactive. Without them the CLI asks questions in the terminal. Always pass --capacitor --package-id=<id> too: ionic start adds Capacitor in any case, and without --package-id the app gets the placeholder ID io.ionic.starter. Ask the user before installing a global package. ionic start installs the Capacitor packages with the npm tag latest, and it has no option for the version. The npm tag latest of the official Capacitor packages no longer fits a Capacitor 8 project, so always pin the version. Step 3 of the ionic-app-creation skill holds the commands that pin Capacitor 8 right after ionic start.
--type value | Framework |
|---|---|
angular | Angular (NgModules, deprecated) |
angular-standalone | Angular (Standalone Components) |
react | React |
vue | Vue |
Use angular-standalone for a new Angular app. The Modules approach with IonicModule is deprecated in Ionic 9. --type=angular --no-interactive creates an NgModules app without a question, and so does a command without --type.
Templates: blank (empty project, single page), tabs (tab-based layout), sidemenu (side menu layout), list (starting project with a list).
For details, see ionic-app-creation.
Run ionic --help for the full and always up-to-date command list.
| Command | Description |
|---|---|
ionic start | Scaffold a new Ionic project. |
ionic serve --no-open | Start a local dev server with live reload. Does not exit, so run it in the background. |
ionic build | Build the web assets. Add --prod for the production configuration. |
ionic generate <type> <name> | Angular projects only. Generate pages, components, services. |
ionic info | Print system/environment info. |
ionic repair | Remove and recreate dependencies and platform files. |
ionic capacitor run <platform> --target=<DEVICE_ID> (ionic cap run) | Build, sync and run on a device. Without --target it asks for a device. |
Useful ionic serve flags: --external (all network interfaces), --port=<port>, --prod, --no-open. Use --no-open when an agent starts the server, so no browser window opens.
Ionic provides more than 90 UI components organized by category. For full API reference (properties, events, methods, slots, CSS custom properties), see the linked reference files or the component page at https://ionicframework.com/docs/api/<name>.
ion-app (root container), ion-content (scrollable area), ion-header, ion-footer, ion-toolbar, ion-title, ion-buttons, ion-back-button, ion-grid/ion-row/ion-col, ion-split-pane.
Key usage:
<ion-header>
<ion-toolbar>
<ion-buttons slot="start">
<ion-back-button defaultHref="/home"></ion-back-button>
</ion-buttons>
<ion-title>Page Title</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<!-- Scrollable content -->
</ion-content>
For details, see components-layout.md.
ion-tabs, ion-tab-bar, ion-tab-button, ion-menu, ion-menu-button, ion-menu-toggle, ion-router-outlet, ion-nav, ion-breadcrumbs.
In Ionic 9, ion-nav no longer integrates with ion-router. It is a standalone stack that never changes the URL.
For details, see components-navigation.md.
ion-input, ion-input-password-toggle, ion-input-otp, ion-textarea, ion-select/ion-select-option, ion-checkbox, ion-toggle, ion-radio/ion-radio-group, ion-range, ion-datetime/ion-datetime-button, ion-picker/ion-picker-column, ion-searchbar, ion-segment/ion-segment-button, ion-segment-view/ion-segment-content.
Key properties shared by most form components: label, labelPlacement (floating, stacked, fixed, start), fill (outline, solid), errorText, helperText, disabled, value, placeholder.
Key events:
ionInput — fires on each keystroke (use for ion-input/ion-textarea).ionChange — fires when value is committed (use for ion-select, ion-toggle, ion-checkbox, ion-range).<ion-input label="Email" labelPlacement="floating" fill="outline"
type="email" placeholder="[email protected]"
errorText="Invalid email" helperText="Enter your email">
</ion-input>
<ion-select label="Country" labelPlacement="floating" fill="outline" interface="popover">
<ion-select-option value="us">United States</ion-select-option>
<ion-select-option value="de">Germany</ion-select-option>
</ion-select>
In Ionic 9, a floating label only floats when the control is focused or has a value. The internal DOM of ion-input, ion-select and ion-textarea changed, so CSS selectors that target internal wrappers have to be checked after an upgrade.
For details, see components-form.md.
ion-modal, ion-alert, ion-toast, ion-action-sheet, ion-loading, ion-popover.
All overlays share: isOpen prop for declarative control, trigger prop to open from a button ID, animated, and lifecycle events (didPresent, didDismiss, willPresent, willDismiss). All except ion-toast also have backdropDismiss. A toast has no backdrop.
Sheet modal (bottom sheet):
<ion-modal [isOpen]="isOpen" [breakpoints]="[0, 0.5, 1]" [initialBreakpoint]="0.5" [handle]="true">
<ion-content>Sheet content</ion-content>
</ion-modal>
For details, see components-overlay.md.
ion-list, ion-item, ion-item-sliding/ion-item-options/ion-item-option, ion-card/ion-card-header/ion-card-content, ion-accordion/ion-accordion-group, ion-chip, ion-badge, ion-label, ion-note. See components-data-display.md.ion-refresher/ion-refresher-content (pull-to-refresh), ion-infinite-scroll/ion-infinite-scroll-content, ion-reorder-group/ion-reorder. See components-scroll.md.ion-button, ion-fab/ion-fab-button, ion-icon, ion-avatar, ion-thumbnail, ion-spinner, ion-skeleton-text, ion-progress-bar. See components-action.md and components-media.md.Nine default colors: primary, secondary, tertiary, success, warning, danger, light, medium, dark. Apply via the color attribute:
<ion-button color="primary">Save</ion-button>
<ion-button color="danger">Delete</ion-button>
Customize a color by overriding all six CSS variables in :root:
:root {
--ion-color-primary: #3880ff;
--ion-color-primary-rgb: 56, 128, 255;
--ion-color-primary-contrast: #ffffff;
--ion-color-primary-contrast-rgb: 255, 255, 255;
--ion-color-primary-shade: #3171e0;
--ion-color-primary-tint: #4c8dff;
}
Key variables: --ion-background-color, --ion-text-color, --ion-font-family, --ion-safe-area-top/right/bottom/left, --ion-margin, --ion-padding. Ionic components such as ion-header, ion-footer, ion-toolbar and ion-tab-bar apply the safe-area insets on their own. Do not add an own inset to them.
Three approaches (import from @ionic/angular/css/, @ionic/react/css/, or @ionic/vue/css/):
@import '@ionic/<framework>/css/palettes/dark.system.css';@import '@ionic/<framework>/css/palettes/dark.always.css';@import '@ionic/<framework>/css/palettes/dark.class.css'; then add .ion-palette-dark to <html>.In an Angular project, write CSS imports without the ~ prefix: @import '@ionic/angular/css/core.css';.
Target platform-specific styles in CSS using the mode class on <html>. Preview a specific mode in the browser with http://localhost:8100/?ionic:mode=ios.
.ios ion-toolbar { --background: #f8f8f8; }
.md ion-toolbar { --background: #ffffff; }
12-column flexbox grid: ion-grid, ion-row, ion-col. Columns expand evenly unless size (1-12) is specified.
| Breakpoint | Min Width | Property Suffix |
|---|---|---|
xs | 0 | Xs |
sm | 576px | Sm |
md | 768px | Md |
lg | 992px | Lg |
xl | 1200px | Xl |
.ion-padding, .ion-padding-top/bottom/start/end, .ion-padding-vertical/horizontal, .ion-no-padding.ion-margin, .ion-margin-top/bottom/start/end, .ion-margin-vertical/horizontal, .ion-no-margin.ion-text-center, .ion-text-start, .ion-text-end, .ion-text-wrap, .ion-text-nowrap.ion-display-none, .ion-display-block, .ion-display-flex. The .ion-hide classes are deprecated in favor of .ion-display-none..ion-justify-content-center, .ion-align-items-center, .ion-flex-row, .ion-flex-column, .ion-flex-wrapText, float and display classes have responsive variants with the breakpoint in the name: .ion-text-md-center applies at 768px and wider.
Ionic provides four lifecycle hooks that fire during page transitions. These exist because ion-router-outlet caches pages in the DOM — framework-native lifecycle hooks (ngOnInit, useEffect, onMounted) only fire once on first creation, not on every page visit.
| Hook | Fires When | Use For |
|---|---|---|
ionViewWillEnter | Page about to enter (pre-animation) | Refresh data on every visit |
ionViewDidEnter | Page fully entered (post-animation) | Start animations, focus inputs |
ionViewWillLeave | Page about to leave (pre-animation) | Save state, pause subscriptions |
ionViewDidLeave | Page fully left (post-animation) | Clean up off-screen resources |
Critical rules:
ion-router-outlet.For full details, see ionic-angular.
Detect architecture: Check src/main.ts for bootstrapApplication (standalone) vs platformBrowserDynamic().bootstrapModule (NgModule).
| Aspect | Standalone | NgModule (lazy build) |
|---|---|---|
| Ionic setup | provideIonicAngular({}) in the app providers | IonicModule.forRoot() in app.module.ts (deprecated in Ionic 9) |
| Component imports | Each component, from @ionic/angular in Ionic 9 and from @ionic/angular/standalone in Ionic 8 | IonicModule provides all globally. Import it from @ionic/angular/lazy in Ionic 9 and from @ionic/angular in Ionic 8. |
| Lazy loading | loadComponent in routes | loadChildren in routes |
| Icons | addIcons() from ionicons required | Automatic |
Never mix the two import paths in one app. The standalone and the lazy build of Ionic cannot be used at the same time.
Navigation: Use NavController for animated navigation (navigateForward, navigateBack, navigateRoot, back). Use routerLink with routerDirection in templates. In a standalone component, import IonRouterLink (or IonRouterLinkWithHref for <a> elements) next to RouterLink.
Lifecycle: Implement interfaces ViewWillEnter, ViewDidEnter, ViewWillLeave, ViewDidLeave:
// Ionic 9. In an Ionic 8 standalone app, import from '@ionic/angular/standalone'.
import { ViewWillEnter } from '@ionic/angular';
@Component({ /* ... */ })
export class HomePage implements ViewWillEnter {
ionViewWillEnter() {
this.loadData(); // Runs on every page visit
}
}
Change detection: Angular 21 made zoneless change detection the default, and Ionic 9 supports it. Without Zone.js, state that is changed in an async callback (an overlay result, setTimeout, an RxJS subscription) does not re-render on its own. On Angular 22, where OnPush is the default, this also holds for a plain field that is set in a lifecycle hook. Use a signal or call ChangeDetectorRef.markForCheck().
For navigation details, see angular/navigation.md. For lifecycle details, see angular/lifecycle.md.
For full details, see ionic-react.
Key setup differences:
setupIonicReact() before rendering.IonReactRouter (from @ionic/react-router) instead of BrowserRouter.IonRouterOutlet to contain routes. In Ionic 9 (React Router 6), pass the page with the element prop: <Route path="/home" element={<Home />} />. In Ionic 8 (React Router 5), use the component prop.IonRouterOutlet needs the /* suffix: <Route path="/tabs/*" element={<Tabs />} />.IonPage as root — required for transitions and lifecycle hooks.Navigation: Use useIonRouter hook for programmatic navigation:
import { useIonRouter } from '@ionic/react';
const router = useIonRouter();
router.push('/detail/123', 'forward', 'push');
router.goBack();
In Ionic 9, useHistory no longer exists. Use useNavigate of React Router or useIonRouter. Route parameters come from useParams, not from props.
Lifecycle hooks (from @ionic/react):
import { useIonViewWillEnter } from '@ionic/react';
useIonViewWillEnter(() => {
fetchData(); // Runs on every page visit
});
Overlay hooks: useIonAlert, useIonToast, useIonActionSheet, useIonLoading, useIonModal, useIonPopover. useIonPicker exists in Ionic 8 only. In Ionic 9, useIonModal and useIonPopover check componentProps against the props of the component.
Form events: Use onIonInput for IonInput/IonTextarea, onIonChange for IonSelect/IonToggle/IonCheckbox/IonRange. Access values via e.detail.value.
For routing details, see react/routing.md. For hooks, see react/hooks.md.
For full details, see ionic-vue.
Key setup differences:
IonicVue plugin in src/main.ts: createApp(App).use(IonicVue).use(router).createRouter and createWebHistory from @ionic/vue-router (not from vue-router).IonPage as root template element — without it, transitions and lifecycle hooks silently fail.@ionic/vue.@ionChange or @ion-change. In JavaScript (addEventListener), write event names in kebab-case.ionicons/icons and bind them with :icon. Never pass the icon name as a string.Navigation: Use useIonRouter composable:
<script setup lang="ts">
import { useIonRouter } from '@ionic/vue';
const ionRouter = useIonRouter();
ionRouter.push('/detail/123');
ionRouter.back();
</script>
Declarative: <ion-button router-link="/detail" router-direction="forward">Go</ion-button>
Lifecycle hooks (from @ionic/vue):
<script setup lang="ts">
import { onIonViewWillEnter } from '@ionic/vue';
onIonViewWillEnter(() => {
fetchData(); // Runs on every page visit
});
</script>
Composables: useIonRouter() (push, replace, back, forward, navigate, canGoBack), useBackButton(priority, handler), useKeyboard(), isPlatform(name), getPlatforms().
In Ionic 9 with Vue Router 5, return a value from navigation guards. Calling next() prints a deprecation warning.
Access Web Component methods via $el: contentRef.value.$el.scrollToBottom(300).
For navigation details, see vue/navigation.md. For composables, see vue/composables.md.
Each framework uses ion-tabs with ion-tab-bar and child routes per tab. Each tab maintains its own navigation stack.
Rules:
tab attribute on ion-tab-button must match the child route path.ion-modal instead of cross-tab routing.Use ion-menu with contentId matching the id on ion-router-outlet. Wrap menu items in ion-menu-toggle to auto-close after selection. Use routerDirection="root" for top-level menu navigation.
Each major version jump must be applied one after the other — do not skip intermediate versions. For the step from Ionic 8 to Ionic 9, the official guide is https://ionicframework.com/docs/updating/9-0. Ionic ships a migration tool for it. It refuses to run on a dirty Git working tree, so commit first. Preview the changes before applying them:
npx --yes @ionic/migrate --dry-run
Run it without --dry-run only after the user agrees. It rewrites files in place, bumps the @ionic/* versions and reinstalls dependencies. It prints a checklist of the changes that need manual work.
For the upgrade guides of the older versions, see ionic-app-upgrades.
Ionic apps use Capacitor for native device features (camera, filesystem, push notifications, etc.). Ionic 9 officially supports Capacitor 7 and later. The standard workflow:
npm run build
npx cap sync
npx cap run android --target <DEVICE_ID>
npx cap run ios --target <DEVICE_ID>
Get the device ID from npx cap run android --list or npx cap run ios --list. Without --target the command asks for a device in the terminal.
For live reload on a device, run ionic cap run android --livereload --external --target=<DEVICE_ID> --public-host=<LAN_IP> (or ios) in the background. It does not exit. <LAN_IP> is the IP address of the development machine in the local network. Without --target and --public-host the command asks in the terminal.
For Capacitor guidance, see the capacitor-app-development skill.
Capawesome Cloud is a mobile DevOps platform for Ionic and Capacitor apps:
See https://capawesome.io/pricing/ for the plans. For setup, see the capawesome-cloud skill.
Ionic Appflow: Ionic stopped selling Appflow to new customers in February 2025, and the service ends on December 31, 2027. The official Ionic documentation still mentions Appflow. Do not set up a new project on it. For an existing Appflow project, use the ionic-appflow-migration skill. For the discontinued Ionic Enterprise plugins (Auth Connect, Identity Vault, Secure Storage), use the ionic-enterprise-sdk-migration skill.
ionic: command not found: The Ionic CLI is not installed. Ask the user, then run npm install -g @ionic/cli.@ionic/angular (Ionic 9) or @ionic/angular/standalone (Ionic 8).@ionic/angular/lazy fails to resolve: The project uses the classic TypeScript moduleResolution: "node". Set moduleResolution to "bundler" in tsconfig.json.ChangeDetectorRef.markForCheck().ionViewWillEnter not firing: The component must be directly routed via ion-router-outlet. Child components do not receive lifecycle events. For React/Vue, verify IonPage is the root element.ionViewWillEnter) instead of framework-native lifecycle hooks (ngOnInit, useEffect, onMounted). Ionic caches pages in the DOM.NavController for Angular, IonReactRouter for React, createRouter from @ionic/vue-router for Vue). Standard framework routers do not trigger Ionic animations.--background, --color) instead of targeting internal elements.addIcons() from ionicons with the required icons and import IonIcon.Failed to resolve component: ion-* (Vue): The Ionic component is not imported. Add the import from @ionic/vue.IonRouterOutlet within IonTabs./* suffix, and the exact prop no longer exists.onIonInput for IonInput/IonTextarea, not onChange. Access values via e.detail.value.'vue/no-deprecated-slot-attribute': 'off'.base in the Vite config breaks the asset paths in a native build. Set base to '/' or remove it, then run npx cap copy.ionic-app-creation — Create a new Ionic app from scratch.ionic-app-development — General Ionic development, full component API reference.ionic-angular — Angular-specific patterns (standalone vs NgModule, navigation, forms, testing).ionic-react — React-specific patterns (IonReactRouter, hooks, state management).ionic-vue — Vue-specific patterns (composables, navigation, IonPage requirement).ionic-app-upgrades — Upgrade Ionic to a newer major version.ionic-appflow-migration: Move a project from Ionic Appflow to Capawesome Cloud.ionic-enterprise-sdk-migration: Replace the discontinued Ionic Enterprise plugins.capacitor-app-development — General Capacitor development.capawesome-cloud: Live updates, native builds, app store publishing, and automations.capawesome-mcp — Connect an MCP client to the hosted Capawesome MCP server for always-current documentation and Capawesome Cloud management.ionic-framework-mcp — Connect an MCP client to the hosted Ionic Framework MCP server for the current component API reference and usage examples.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
ionic-framework, cross-platform, mobile-ui, capacitor, web-components
npx claudepluginhub capawesome-team/skills --plugin ionic-core5 skills in this plugin
/ionic-app-creationGuides the agent through creating a new Ionic app using the Ionic CLI. Covers project scaffolding with ionic start in a form that asks no terminal questions, framework selection (Angular, React, Vue), template selection (blank, tabs, sidemenu, list), Capacitor integration, and optional Tailwind CSS setup. After app creation with Capacitor integration, delegates to the capacitor-app-creation skill for further Capacitor setup. Do not use for existing Ionic projects, migrating Ionic apps, upgrading Capacitor versions, or non-Ionic mobile frameworks./ionic-app-developmentGuides the agent through general Ionic Framework development including core concepts, component reference, CLI usage, layout, theming, animations, gestures, development workflow, and troubleshooting. Covers all Ionic UI components grouped by category with properties, events, methods, slots, and CSS custom properties. Do not use for creating a new Ionic app (use ionic-app-creation), framework-specific patterns (use ionic-angular, ionic-react, ionic-vue), or upgrading Ionic versions (use ionic-app-upgrades)./ionic-app-upgradesGuides the agent through upgrading an Ionic Framework app to a newer major version. Supports upgrades from Ionic 4 through 9, including multi-version jumps. Covers the automated Ionic migration tool for Ionic 9, framework-specific steps for Angular, React, and Vue (including the moves to React Router 6 and Vue Router 5), component breaking changes, CSS changes, and browser support changes. Do not use for Capacitor version upgrades (use capacitor-app-upgrades instead), for plugin library upgrades, or for non-Ionic UI frameworks.Other plugins' skills for the same job