Snax is an implementation of a JSX-like grammar for Rust. You can use it as
part of the snax
crate, which provides a complete, untyped DOM that's
quick to turn into a string.
If you're a proc macro author, you can also consume the snax_syntax
to
produce whatever structures you need for your project. This can be used to
support a typed DOM or any React-like framework!
Installation
Snax requires Rust 1.32 or newer.
It isn't published to crates.io yet, but you can use a Git dependency:
= { = "https://github.com/LPGhatguy/snax.git" }
Some things are still a bit in flux, so I'm sorry in advance if I break anything!
Examples
Simple Page
use snax;
Composition via functions
Snax is designed to work well when using functions to reuse pieces of HTML!
use ;
License
Snax is available under the MIT license. See LICENSE.txt for details.