mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* Add links to the sidebar.
* Remove unnecessary `page-ref`s (these links are now in the sidebar).
* Small grammar/style fix.
* Fix code tabs.
* Remove {% page-ref %} uses.
* Fix some line lengths.
* Split out `custom.css` into multiple files.
* Remove duplicate titles.
1.1 KiB
1.1 KiB
| id | title | description |
|---|---|---|
| html-intro | Introduction | The procedural macro for generating HTML and SVG |
The html! macro allows you to write HTML and SVG code declaratively. It is similar to JSX
an extension to Javascript which allows you to write HTML-like code inside of Javascript.
Important notes
- The
html!macro only accepts one root html node (you can counteract this by using fragments or iterators) - An empty
html! {}invocation is valid and will not render anything - Literals must always be quoted and wrapped in braces:
html! { "Hello, World" }
:::note
The html! macro can reach easily the default recursion limit of the compiler. It is advised to
bump its value if you encounter compilation errors. Use an attribute like
#![recursion_limit="1024"] in the crate root i.e. either `lib.rs` or `main.rs` to overcome the
problem.
See the official documentation and this Stack Overflow question for details. :::