用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill ionic命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | ionic |
| description | Ionic hybrid mobile framework with web technologies. Use for hybrid mobile apps. |
Ionic Framework is an open-source UI toolkit for building performant, high-quality mobile and desktop apps using web technologies (HTML, CSS, JavaScript) with integrations for Angular, React, and Vue.
# Install CLI
npm install -g @ionic/cli
# Start a React app with tabs
ionic start myApp tabs --type=react --capacitor
cd myApp
ionic serve
// src/pages/Home.tsx (Ionic React)
import {
IonContent,
IonHeader,
IonPage,
IonTitle,
IonToolbar,
IonButton,
IonIcon,
IonList,
IonItem,
IonLabel,
} from "@ionic/react";
import { camera } from "ionicons/icons";
import { Camera, CameraResultType } from "@capacitor/camera";
const Home: React.FC = () => {
const takePhoto = async () => {
const image = await Camera.getPhoto({
quality: 90,
allowEditing: false,
resultType: CameraResultType.Uri,
});
console.log("Photo URI", image.webPath);
};
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonTitle>Ionic Camera</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent fullscreen>
<div style={{ padding: 20 }}>
<IonButton expand="block" onClick={takePhoto}>
<IonIcon slot="start" icon={camera} />
Take Photo
</IonButton>
</div>
</IonContent>
</IonPage>
);
};
export default Home;
Ionic components (<ion-button>, <ion-card>) are Web Components. They work in any framework (or no framework) and encapsulate their styles and behavior (Shadow DOM).
Ionic automatically adapts the look and feel based on the platform.
Ionic uses Capacitor as the native bridge. It provides a Native Runtime for the web app and exposes native APIs (Camera, Geolocation, Haptics) via JavaScript plugins.
Crucial for startup performance.
loadChildren in Router.React.lazy and Suspense.Modals, Alerts, and Action Sheets are handled via controllers or hooks (useIonModal), ensuring they render outside the regular DOM flow for proper z-indexing.
Do:
ion-img instead of img for efficient lazy loading within ion-content.Don't:
z-index to fix layering (use Ionic utilities/slots).| Error | Cause | Solution |
|---|---|---|
White Screen of Death | JavaScript error during startup. | Check remote debugging console (Chrome/Safari). |
CORS Error on device | Web View calling external API. | Configure server CORS or use @capacitor-community/http. |
Keyboard covers input | Scroll view not resizing. | Ensure <ion-content> is used; check windowSoftInputMode. |