Catalog / Ionic Framework Cheat Sheet
Ionic Framework Cheat Sheet
A comprehensive cheat sheet for the Ionic Framework, covering essential commands, components, and concepts for building cross-platform mobile applications.
Ionic CLI Basics
Project Management
|
Create a new Ionic project. Example: |
|
Run the app in the browser for development. Example: |
|
Build the app for a specific platform (e.g., web). Example: |
|
Add a platform (e.g., android, ios) to the project. Example: |
|
Run the app on a connected device or emulator. Example: |
|
Generate components, pages, services, etc. Example: |
Configuration
The Key settings include |
Environment variables can be set using |
Use |
Core Components
Basic UI Elements
|
The header of a page. Contains |
|
The main content area of a page. Used for displaying text, images, and other components. |
|
The footer of a page. Used for displaying navigation or additional information. |
|
A clickable button element. Supports various styles and sizes. |
|
A text input field. Supports different types of input (text, number, email, etc.). |
|
A container for list items. Used with |
Navigation
|
A container for managing navigation history. |
|
Displays the current page based on the router configuration. |
|
Angular directive for navigating to a specific route. Example: |
|
Service for programmatic navigation. Example: |
Ionic Native & Plugins
Working with Native Features
Ionic Native provides a wrapper around Cordova plugins, making them easier to use in Angular projects. |
Install plugins via Cordova or Capacitor CLI:
|
Import and use plugins in your Angular components:
|
Common Plugins
|
Access the device camera for taking pictures and videos. |
|
Access the device’s GPS for location information. |
|
Scan barcodes and QR codes. |
|
Manage the app’s splash screen. |
|
Control the device’s status bar appearance. |
|
Access the device’s file system. |
Theming and Styling
CSS Variables (Custom Properties)
Ionic uses CSS variables for theming. You can override these variables to customize the look and feel of your app. Example:
|
Theme variables are defined in the |
Modes
Ionic supports different modes (MD for Material Design, iOS for iOS style). The mode is automatically set based on the platform. |
You can force a specific mode:
|
Global Styles
Global styles can be defined in the |
Use CSS classes and selectors to style your components. Example:
|