How to create a new ionic project
To create a new Ionic project, you can follow these steps:
Method 1: Using the Ionic CLI
- Open your terminal or command prompt.
- Install the Ionic CLI by running the following command:
npm install -g @ionic/cli
(oryarn global add @ionic/cli
if you're using Yarn). - Once the installation is complete, run the following command to create a new Ionic project:
ionic start myApp blank
(replace "myApp" with your desired app name and "blank" with the template you want to use, such as "tabs" or "sidemenu"). - Follow the prompts to choose the template, framework, and other options.
- Once the project is created, navigate to the project directory:
cd myApp
- Run
ionic serve
to start the app in a browser.
Method 2: Using the Ionic Website
- Go to the Ionic website (www.ionicframework.com) and click on the "Get Started" button.
- Choose the template you want to use (e.g. "Blank", "Tabs", "Sidemenu", etc.).
- Fill in the required information, such as your app name and description.
- Click on the "Create Project" button.
- Download the project zip file and extract it to a directory on your computer.
- Open the project directory in your code editor and run
ionic serve
to start the app in a browser.
Additional Options
- You can also specify additional options when creating a new project, such as:
--type
: specifies the type of project (e.g. "ionic-angular" for an Angular-based project, or "ionic-react" for a React-based project).--framework
: specifies the framework to use (e.g. "angular" or "react").--template
: specifies the template to use (e.g. "blank", "tabs", "sidemenu", etc.).--language
: specifies the language to use (e.g. "typescript" or "javascript").
For example, to create a new Ionic Angular project with the "tabs" template, you can run the following command: ionic start myApp tabs --type ionic-angular --framework angular