Getting Started
Installation
The natrix cli requires the following dependencies:
- Rust/Cargo
- wasm-bindgen
- wasm-opt, Usually installed via
binaryen
for your platform.
Install the natrix cli with the following command:
cargo install --locked natrix-cli
Creating a new project
To create a new natrix project, run the following command:
natrix new <project-name>
This will by default use nightly rust, if you wish to use stable rust, you can use the --stable
flag:
natrix new <project-name> --stable
All features work on stable rust, but nightly includes more optimizations as well as results in smaller binaries. As well as provides some quality of life improvements. see Features for more information.
Running the project
To run the project, navigate to the project directory and run:
natrix dev
This will start a local server that auto reloads on changes. Try changing the text in src/main.rs
to see the changes live.
Further Reading
- Components - Components are the core of natrix, and are the most important part of the framework.
- Html - This goes over the
html_elements
module and how to use it.