Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DioxusLabs/dioxus-html-macro
An html macro for dioxus applications.
https://github.com/DioxusLabs/dioxus-html-macro
Last synced: 3 months ago
JSON representation
An html macro for dioxus applications.
- Host: GitHub
- URL: https://github.com/DioxusLabs/dioxus-html-macro
- Owner: DioxusLabs
- License: apache-2.0
- Created: 2022-07-05T23:41:13.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-07T12:23:42.000Z (3 months ago)
- Last Synced: 2024-10-12T23:38:05.138Z (3 months ago)
- Language: Rust
- Size: 101 KB
- Stars: 28
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-list - DioxusLabs/dioxus-html-macro - html-macro?style=social"/> : An html macro for dioxus applications. (GUI)
- awesome-rust-list - DioxusLabs/dioxus-html-macro - html-macro?style=social"/> : An html macro for dioxus applications. (GUI)
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}"
)
```