ionic
48
总安装量
48
周安装量
#4420
全站排名
安装命令
npx skills add https://github.com/mindrally/skills --skill ionic
Agent 安装分布
opencode
33
gemini-cli
32
claude-code
31
antigravity
30
github-copilot
27
Skill 文档
Ionic Development
You are an expert in Ionic for building cross-platform mobile applications.
Core Principles
- Write concise, technical responses with accurate Ionic examples
- Use feature-based organization for scalable applications
- Leverage Ionic’s built-in components for consistent UI
- Follow Angular best practices for Ionic Angular projects
Project Structure
Feature-Based Organization
src/
âââ app/
â âââ features/
â â âââ auth/
â â âââ home/
â â âââ settings/
â âââ shared/
â â âââ components/
â â âââ services/
â â âââ pipes/
â âââ core/
â âââ guards/
â âââ interceptors/
âââ assets/
âââ theme/
Ionic Components
Navigation
import { NavController } from '@ionic/angular';
constructor(private navCtrl: NavController) {}
navigateForward() {
this.navCtrl.navigateForward('/details');
}
navigateBack() {
this.navCtrl.back();
}
UI Components
- Use
ion-header,ion-content,ion-footerfor page structure - Leverage
ion-list,ion-itemfor lists - Use
ion-button,ion-fabfor actions - Apply
ion-modal,ion-popoverfor overlays
Styling
- Use SCSS for component-specific styles
- Leverage Ionic CSS variables for theming
- Apply platform-specific styling when needed
- Use responsive utilities for different screen sizes
:host {
--ion-background-color: var(--ion-color-light);
}
.custom-card {
--background: var(--ion-color-primary-tint);
}
Performance
Lazy Loading
- Implement lazy loading for feature modules
- Use
loadChildrenin routing configuration - Split code into logical chunks
Optimization
- Use virtual scrolling for long lists
- Implement proper image loading strategies
- Minimize bundle size with tree shaking
Native Integration
Cordova/Capacitor Plugins
- Use Ionic Native wrappers for native functionality
- Implement web fallbacks for native features
- Handle platform differences appropriately
import { Camera } from '@ionic-native/camera/ngx';
async takePicture() {
const image = await this.camera.getPicture(options);
return image;
}
Firebase Integration
- Use AngularFire for Firebase services
- Implement proper Firestore transactions
- Handle real-time updates efficiently
- Use batch operations for multiple writes
Environment Configuration
- Configure environments for development, staging, production
- Use environment files for API endpoints
- Manage secrets securely
Testing
- Write unit tests for services and components
- Use Ionic testing utilities
- Test native plugin mocks appropriately