Create a new project
You can create a new Dioxus project by running the following command and following the prompts:
dx new
First you will need to select a platform. Each platform has its own reference with more information on how to set up a project for that platform. Here are the platforms we recommend starting with:
- Web
- Client Side: runs in the browser through WebAssembly
- Fullstack: renders to HTML text on the server and hydrates it on the client
If you are not sure which web platform you want to use, check out the choosing a web renderer chapter.
- WebView
- Desktop: runs in a web view on desktop
- Mobile: runs in a web view on mobile. Mobile is currently not supported by the dioxus CLI. The mobile reference has more information about setting up a mobile project
Next, you can choose a styling library. For this project, we will use vanilla CSS.
Finally, you can choose to start the project with the router enabled. The router is covered in the router guide.
Running the project
Once you have created your project, you can start it with the following command:
cd my_project dx serve
For projects using the liveview template, run dx serve --desktop
.
For Web targets the application will be served at http://localhost:8080
Conclusion
That's it! You now have a working Dioxus project. You can continue learning about dioxus by making a hackernews clone in the guide, or learning about specific topics/platforms in the reference. If you have any questions, feel free to ask in the discord or open a discussion.