Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/DioxusLabs/dioxus-html-macro

An html macro for dioxus applications.
https://github.com/DioxusLabs/dioxus-html-macro

Last synced: about 2 months ago
JSON representation

An html macro for dioxus applications.

Awesome Lists containing this project

README

        

# dioxus html macro
This crate offers an `html!` like macro for
dioxus applications. It expands to the equivalent `rsx!` macro
call you would have made otherwise, so it does not rely on any
dioxus' internals.
```rust
use dioxus::prelude::*;
use dioxus_html_macro::html;

fn app(cx: Scope) -> Element {
let mut count = use_state(&cx, || 0);
cx.render(html!(

"High-Five counter: {count}"


"Up high!"
"Down low!"
))
}
```
Note that unlike HTML and JSX, styling of html tags is done via
attributes:
```rust
html!(

"High-Five counter: {count}"


)
```