← 返回 Skills 市场
robingenz

Ionic Expert

作者 Robin Genz · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
143
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ionic-expert
功能描述
A comprehensive starting point for AI agents to work with the Ionic Framework. Covers core concepts, components, CLI, theming, layout, lifecycle, navigation,...
使用说明 (SKILL.md)

Ionic Expert

Comprehensive reference for Ionic Framework development — core concepts, components, theming, lifecycle, navigation, framework-specific patterns (Angular, React, Vue), upgrading, and Capawesome Cloud integration.

Core Concepts

Ionic Framework is a UI toolkit for building cross-platform apps with web technologies. It provides 80+ pre-built UI components as Web Components prefixed with ion- (e.g., \x3Cion-button>, \x3Cion-content>).

  • Platform modes: Components adapt styling to the platform. iOS devices use ios mode; Android and all other platforms use md (Material Design). The \x3Chtml> element receives a class (ios or md).
  • Capacitor integration: Ionic handles the UI; Capacitor handles native device APIs. See the capacitor-app-development skill for Capacitor guidance.
  • Framework support: Ionic integrates with Angular (@ionic/angular), React (@ionic/react), and Vue (@ionic/vue).

Creating a New App

npm install -g @ionic/cli
ionic start \x3Cname> \x3Ctemplate> --type=\x3Cframework> --capacitor --package-id=\x3Cid>
--type value Framework
angular Angular (NgModules)
angular-standalone Angular (Standalone Components)
react React
vue Vue
Template Description
blank Empty project, single page
tabs Tab-based layout
sidemenu Side menu layout

For details, see ionic-app-creation.

Ionic CLI

Run ionic --help for the full and always up-to-date command list.

Command Description
ionic start Scaffold a new Ionic project.
ionic serve Start a local dev server with live reload (port 8100).
ionic build Build the web app for production.
ionic generate Generate pages, components, services (framework-dependent).
ionic info Print system/environment info.
ionic repair Remove and recreate dependencies and platform files.

Useful ionic serve flags: --external (all network interfaces), --port=\x3Cport>, --prod, --no-open.

Components Overview

Ionic provides 80+ UI components organized by category. For full API reference (properties, events, methods, slots, CSS custom properties), see the linked reference files.

Layout

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:

\x3Cion-header>
  \x3Cion-toolbar>
    \x3Cion-buttons slot="start">
      \x3Cion-back-button defaultHref="/home">\x3C/ion-back-button>
    \x3C/ion-buttons>
    \x3Cion-title>Page Title\x3C/ion-title>
  \x3C/ion-toolbar>
\x3C/ion-header>
\x3Cion-content>
  \x3C!-- Scrollable content -->
\x3C/ion-content>

For details, see components-layout.md.

Navigation

ion-tabs, ion-tab-bar, ion-tab-button, ion-menu, ion-menu-button, ion-menu-toggle, ion-router-outlet, ion-nav, ion-breadcrumbs.

For details, see components-navigation.md.

Form

ion-input, ion-textarea, ion-select/ion-select-option, ion-checkbox, ion-toggle, ion-radio/ion-radio-group, ion-range, ion-datetime/ion-datetime-button, ion-searchbar, ion-segment/ion-segment-button, ion-input-otp.

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).
\x3Cion-input label="Email" labelPlacement="floating" fill="outline"
           type="email" placeholder="[email protected]"
           errorText="Invalid email" helperText="Enter your email">
\x3C/ion-input>

\x3Cion-select label="Country" labelPlacement="floating" fill="outline" interface="popover">
  \x3Cion-select-option value="us">United States\x3C/ion-select-option>
  \x3Cion-select-option value="de">Germany\x3C/ion-select-option>
\x3C/ion-select>

For details, see components-form.md.

Overlays

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, backdropDismiss, animated, and lifecycle events (didPresent, didDismiss, willPresent, willDismiss).

Sheet modal (bottom sheet):

\x3Cion-modal [isOpen]="isOpen" [breakpoints]="[0, 0.5, 1]" [initialBreakpoint]="0.5" [handle]="true">
  \x3Cion-content>Sheet content\x3C/ion-content>
\x3C/ion-modal>

For details, see components-overlay.md.

Data Display

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.

For details, see components-data-display.md.

Scroll

ion-refresher/ion-refresher-content (pull-to-refresh), ion-infinite-scroll/ion-infinite-scroll-content, ion-reorder-group/ion-reorder.

For details, see components-scroll.md.

Actions & Media

ion-button, ion-fab/ion-fab-button, ion-icon, ion-avatar, ion-thumbnail, ion-spinner, ion-skeleton-text, ion-progress-bar.

For details, see components-action.md and components-media.md.

Theming

Colors

Nine default colors: primary, secondary, tertiary, success, warning, danger, light, medium, dark. Apply via the color attribute:

\x3Cion-button color="primary">Save\x3C/ion-button>
\x3Cion-button color="danger">Delete\x3C/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;
}

Global CSS Variables

Key variables: --ion-background-color, --ion-text-color, --ion-font-family, --ion-safe-area-top/right/bottom/left, --ion-margin, --ion-padding.

Dark Mode

Three approaches (import from @ionic/angular/css/, @ionic/react/css/, or @ionic/vue/css/):

  1. System preference (default): @import '@ionic/\x3Cframework>/css/palettes/dark.system.css';
  2. Always dark: @import '@ionic/\x3Cframework>/css/palettes/dark.always.css';
  3. CSS class toggle: @import '@ionic/\x3Cframework>/css/palettes/dark.class.css'; then add .ion-palette-dark to \x3Chtml>.

Platform Styles

Target platform-specific styles in CSS using the mode class on \x3Chtml>:

.ios ion-toolbar { --background: #f8f8f8; }
.md ion-toolbar { --background: #ffffff; }

Preview a specific mode in the browser: http://localhost:8100/?ionic:mode=ios

Layout

Grid System

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

CSS Utility Classes

  • Padding: .ion-padding, .ion-padding-top/bottom/start/end, .ion-no-padding
  • Margin: .ion-margin, .ion-margin-top/bottom/start/end, .ion-no-margin
  • Text: .ion-text-center, .ion-text-start, .ion-text-end, .ion-text-wrap, .ion-text-nowrap
  • Display: .ion-display-none, .ion-display-block, .ion-display-flex
  • Flex: .ion-justify-content-center, .ion-align-items-center, .ion-flex-row, .ion-flex-column

All utility classes support responsive suffixes: .ion-text-md-center (applies at 768px+).

Page Lifecycle

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:

  • Only fire on components directly mapped to a route via ion-router-outlet.
  • Child components do not receive these events.
  • The component must use the framework-specific page wrapper (see framework sections below).

Framework-Specific Patterns

Angular

For full details, see ionic-angular.

Detect architecture: Check src/main.ts for bootstrapApplication (standalone) vs platformBrowserDynamic().bootstrapModule (NgModule).

Aspect Standalone NgModule
Ionic setup provideIonicAngular({}) in app.config.ts IonicModule.forRoot() in app.module.ts
Component imports Each from @ionic/angular/standalone IonicModule provides all globally
Lazy loading loadComponent in routes loadChildren in routes
Icons addIcons() from ionicons required Automatic

Navigation: Use NavController from @ionic/angular for animated navigation (navigateForward, navigateBack, navigateRoot, back). Use routerLink with routerDirection in templates.

Lifecycle: Implement interfaces ViewWillEnter, ViewDidEnter, ViewWillLeave, ViewDidLeave from @ionic/angular:

import { ViewWillEnter } from '@ionic/angular';

@Component({ /* ... */ })
export class HomePage implements ViewWillEnter {
  ionViewWillEnter() {
    this.loadData(); // Runs on every page visit
  }
}

For navigation details, see angular/navigation.md. For lifecycle details, see angular/lifecycle.md.

React

For full details, see ionic-react.

Key setup differences:

  • Call setupIonicReact() before rendering in src/main.tsx.
  • Use IonReactRouter (from @ionic/react-router) instead of BrowserRouter.
  • Use IonRouterOutlet to contain routes with the component prop (not render or children).
  • Every page must render 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();

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.

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.

Vue

For full details, see ionic-vue.

Key setup differences:

  • Install IonicVue plugin in src/main.ts: createApp(App).use(IonicVue).use(router).
  • Import createRouter from @ionic/vue-router (not from vue-router).
  • Every page must use IonPage as root template element — without it, transitions and lifecycle hooks silently fail.
  • Import all Ionic components from @ionic/vue.
  • Use kebab-case for event names in templates (@ion-change, @ion-input).
  • Import icons as SVG references from ionicons/icons — never as strings.

Navigation: Use useIonRouter composable:

\x3Cscript setup lang="ts">
import { useIonRouter } from '@ionic/vue';

const ionRouter = useIonRouter();
ionRouter.push('/detail/123');
ionRouter.back();
\x3C/script>

Declarative: \x3Cion-button router-link="/detail" router-direction="forward">Go\x3C/ion-button>

Lifecycle hooks (from @ionic/vue):

\x3Cscript setup lang="ts">
import { onIonViewWillEnter } from '@ionic/vue';

onIonViewWillEnter(() => {
  fetchData(); // Runs on every page visit
});
\x3C/script>

Composables: useIonRouter(), useBackButton(priority, handler), useKeyboard(), isPlatform(name), getPlatforms().

Access Web Component methods via $el: contentRef.value.$el.scrollToBottom(300).

For navigation details, see vue/navigation.md. For composables, see vue/composables.md.

Navigation Patterns

Tab Navigation

Each framework uses ion-tabs with ion-tab-bar and child routes per tab. Each tab maintains its own navigation stack.

Rules:

  • The tab attribute on ion-tab-button must match the child route path.
  • Never navigate between tabs programmatically — only the tab bar buttons should switch tabs.
  • For shared views across tabs, use ion-modal instead of cross-tab routing.

Side Menu

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.

Linear vs. Non-Linear Routing

  • Linear: Sequential forward/back navigation (list -> detail -> edit). Back button returns to the previous page.
  • Non-linear: Multiple independent stacks (tabs). Back navigation stays within the current tab's stack.

Use non-linear routing for tabs or split-pane layouts. Use linear routing for simple page flows.

Upgrading

Ionic supports upgrades from version 4 through 8. Each major version jump must be applied sequentially — do not skip intermediate versions.

For full upgrade guides, see ionic-app-upgrades.

Capacitor Integration

Ionic apps use Capacitor for native device features (camera, filesystem, push notifications, etc.). The standard workflow:

npm run build
npx cap sync
npx cap run android
npx cap run ios

For live reload on a device:

ionic cap run android --livereload --external
ionic cap run ios --livereload --external

For Capacitor guidance, see the capacitor-app-development skill.

Capawesome Cloud

Capawesome Cloud provides CI/CD services for Ionic/Capacitor apps:

  • Live Updates — Deploy OTA updates to Ionic/Capacitor apps instantly, without app store review.
  • Native Builds — Build iOS and Android binaries in the cloud without local Xcode or Android Studio.
  • App Store Publishing — Automate submissions to the Apple App Store and Google Play Store.

Visit capawesome.io for the full Capawesome ecosystem. For setup, see the capawesome-cloud skill.

Common Troubleshooting

  • ionic: command not found: Run npm install -g @ionic/cli.
  • Components not rendering: Verify Ionic CSS files are imported in the global stylesheet. For standalone Angular, verify each component is imported from @ionic/angular/standalone.
  • 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.
  • Page data not refreshing on back navigation: Use Ionic lifecycle hooks (ionViewWillEnter) instead of framework-native lifecycle hooks (ngOnInit, useEffect, onMounted). Ionic caches pages in the DOM.
  • Page transitions not animating: Use the framework's Ionic router integration (NavController for Angular, IonReactRouter for React, createRouter from @ionic/vue-router for Vue). Standard framework routers do not trigger Ionic animations.
  • CSS custom properties not applying: Ionic components use Shadow DOM. Use documented CSS custom properties (--background, --color) instead of targeting internal elements.
  • Icons not showing (Angular standalone): Call addIcons() from ionicons with the required icons and import IonIcon from @ionic/angular/standalone.
  • Failed to resolve component: ion-* (Vue): The Ionic component is not imported. Add the import from @ionic/vue.
  • Tab bar disappears on sub-page (React): All routes (including detail routes) must be inside the IonRouterOutlet within IonTabs.
  • Form input values not updating (React): Use onIonInput for IonInput/IonTextarea, not onChange. Access values via e.detail.value.
  • Slot attribute deprecation warning (Vue): Ionic uses Web Component slots. Disable the ESLint rule: 'vue/no-deprecated-slot-attribute': 'off'.

Related Skills

安全使用建议
This skill is an instruction-only Ionic reference and appears coherent with that purpose. Before installing or using it: (1) verify the skill source if you care about provenance — the registry metadata lists no homepage, though the SKILL.md points to a capawesome-team GitHub repo; (2) be aware the docs recommend running npm install -g @ionic/cli (a standard global install that requires npm/node on your machine and appropriate permissions); (3) if you later use Capawesome Cloud features, only provide API keys or tokens to trusted endpoints and check the specific skill that requests them; and (4) because this is documentation-only, it does not by itself execute code or request credentials, so platform risk is minimal. If you want higher assurance, compare the SKILL.md content to the upstream GitHub repository linked in the file metadata.
功能分析
Type: OpenClaw Skill Name: ionic-expert Version: 1.0.0 The ionic-expert skill bundle is a comprehensive documentation and instruction set for AI agents assisting with Ionic Framework development. It covers standard CLI commands, component APIs, and framework-specific patterns for Angular, React, and Vue without any evidence of malicious intent, data exfiltration, or unauthorized execution. All instructions and links (e.g., to capawesome.io) are consistent with legitimate development practices and the stated purpose of the skill.
能力评估
Purpose & Capability
The name and description match the SKILL.md content: the document is a comprehensive Ionic reference (components, CLI commands, theming, navigation, framework-specific patterns). The guidance to use the Ionic CLI and npm is appropriate and expected for this subject.
Instruction Scope
The instructions are documentation and examples for Ionic development. They show CLI commands (npm install -g @ionic/cli, ionic start, ionic serve, etc.) and HTML/JSX snippets. The SKILL.md does not instruct the agent to read unrelated files, access arbitrary environment variables, exfiltrate data, or call unexpected external endpoints beyond public documentation links.
Install Mechanism
There is no install spec and no code files (instruction-only), so nothing is written to disk by the platform. The only installation guidance in the text is to install the official @ionic/cli via npm, which is an expected, standard instruction for Ionic development.
Credentials
The skill declares no required environment variables or credentials (which is proportional). Note: the documentation references Capawesome Cloud integration; if you later use features that integrate with Capawesome Cloud you may need to provide credentials—those are not requested here. Also the SKILL.md suggests global npm installs which require local npm/node permissions but do not require secrets.
Persistence & Privilege
always: false and no install script; the skill does not request permanent presence or elevated platform privileges. It is user-invocable and allows autonomous invocation by default (the platform default), which is expected for skills and not, by itself, concerning.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ionic-expert
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ionic-expert 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the ionic-expert skill: a comprehensive reference for building apps with the Ionic Framework. - Covers core concepts, project scaffolding, CLI commands, theming, layout, navigation, forms, overlays, data display, scroll features, and action/media components. - Includes framework-specific notes for Angular, React, and Vue. - Provides quick-reference usage examples, key events and properties, and links out to in-depth resources for each component category. - Designed as a starting point and overview for Ionic development, with suggestions for pairing with companion skills for more advanced topics.
元数据
Slug ionic-expert
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Ionic Expert 是什么?

A comprehensive starting point for AI agents to work with the Ionic Framework. Covers core concepts, components, CLI, theming, layout, lifecycle, navigation,... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 143 次。

如何安装 Ionic Expert?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ionic-expert」即可一键安装,无需额外配置。

Ionic Expert 是免费的吗?

是的,Ionic Expert 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Ionic Expert 支持哪些平台?

Ionic Expert 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ionic Expert?

由 Robin Genz(@robingenz)开发并维护,当前版本 v1.0.0。

💬 留言讨论