Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality. Learn more →
Top 23 Rust HTML Projects
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
sauron
A versatile web framework and library for building client-side and server-side web applications
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
We have a web components example here: https://github.com/DioxusLabs/dioxus/blob/fd21c971038840130f...
Everything should work like normal except: attributes are not typed, custom event listeners must be implemented with web-sys
You can also use HTML templating with crates like askama, tera and maud! This can be combined with the power of lightweight JavaScript libraries like htmx to speed up time to production. You can read more about this on our other article about using HTMX with Rust which you can find here.. We also collaborated with Stefan Baumgartner on an article for serving HTML with Askama!
Note that Leptos uses Trunk to serve the client side application. Trunk is a zero-config Wasm web application bundler for Rust.
I have inlined the CSS here, and you can use Rust-based tooling like Lightning CSS to minify and bundle CSS here. You might also want to create a Rust build script to generate the HTML from a template, using the askama crate (works a little like Jinja).
Perseus is a fast frontend web development framework for Rust with built-in support for reactivity using Sycamore, server-side rendering, and much more. Sycamore is a frontend library that allows you to build interactive user interfaces with Rust. I’d say that Perseus is to Sycamore as Next.js is to React, so it’ll be helpful for you to have a fair understanding of Sycamore before jumping into using Perseus — although it’s not necessary to follow along in this article.
Would you consider using some libraries in your project? There are lots of good ones in the Rust ecosystem, and many of them are not part of any existing browsers.
For example:
- https://github.com/servo/html5ever (HTML parsing - note: this is used in Servo)
- https://github.com/parcel-bundler/lightningcss (CSS parsing)
- https://github.com/DioxusLabs/taffy (web layout)
- https://github.com/pop-os/cosmic-text (text layout and rendering)
Obviously you should be free to work on whatever you like, but just as a benchmark on the scope of your project: I spent ~6 months implementing just the CSS Grid algorithm in Taffy last year. An entire browser from literal scratch is probably a 10 year project for one person.
Project mention: Templ: A language for writing HTML user interfaces in Go | news.ycombinator.com | 2023-12-10I would like to mention maud in this context:
https://github.com/lambda-fairy/maud
It is refreshingly different from other Rust templating libraries. It uses a proc-macro that compiles your HTML into Rust code. I also happen to use it in conjunction with HTMX and it works very well for me (at least in small projects).
Project mention: Ultron - a WIP web base editor with themes and syntax highlighting | /r/rust | 2023-07-01This project started as a way to test out sauron web framework, but it turns out to be usable and can be embedded in a web applications such as markdown source code renderer.
Project mention: What are the scenarios where "Rewrite it in Rust" didn't meet your expectations or couldn't be successfully implemented? | /r/rust | 2023-06-09Exactly the same experience. In particular I ran into the issue that the only "ergonomic" API (that doesn't require hand-writing a parser) uses serde derive macros, but quick_xml doesn't handle namespaces. After about a day of this I stopped bike-shedding and just used lxml in Python. It works fine (and I have a large XML file, ~2.4Gb).
Ructe
Project mention: Hyper – A fast and correct HTTP implementation for Rust | news.ycombinator.com | 2023-05-12Any recommendations for rust template engines? I'd like something that can easily render labeled fragments of a template instead of requiring me to split a page into a dozen little files. Kinda like inline {{block}} definitions in Go's html/template. Speed is also nice.
From template-benchmark-rs [0] I found sailfish [1] (fast, but no fragments(?)). render-rs [2] and syn-rsx [3] (2022) both let you write html in rust macros which is cool (maybe that can substitute for fragments?). Then there's gtmpl-rust [4] which is just Go templates reimplemented in rust.
[0]: https://github.com/rosetta-rs/template-benchmarks-rs
[1]: https://github.com/rust-sailfish/sailfish
[2]: https://github.com/render-rs/render.rs last updated Jul 2020
[3]: https://github.com/stoically/syn-rsx last updated Nov 2022
Project mention: Hyper – A fast and correct HTTP implementation for Rust | news.ycombinator.com | 2023-05-12Any recommendations for rust template engines? I'd like something that can easily render labeled fragments of a template instead of requiring me to split a page into a dozen little files. Kinda like inline {{block}} definitions in Go's html/template. Speed is also nice.
From template-benchmark-rs [0] I found sailfish [1] (fast, but no fragments(?)). render-rs [2] and syn-rsx [3] (2022) both let you write html in rust macros which is cool (maybe that can substitute for fragments?). Then there's gtmpl-rust [4] which is just Go templates reimplemented in rust.
[0]: https://github.com/rosetta-rs/template-benchmarks-rs
[1]: https://github.com/rust-sailfish/sailfish
[2]: https://github.com/render-rs/render.rs last updated Jul 2020
[3]: https://github.com/stoically/syn-rsx last updated Nov 2022
Project mention: Ryde is a single person, single file web development library for rust | news.ycombinator.com | 2024-02-29
Rust HTML related posts
- RSS Please – Generate RSS feeds from web pages
- CSS for Printing to Paper
- Deploying your Rust WASM Game to Web with Shuttle & Axum
- Getting Started with Actix Web - The Battle-tested Rust Framework
- Getting Started with Axum - Rust's Most Popular Framework
- RustGPT: ChatGPT UI Built with Rust, Htmx, SQLite
- Announcing Stilts v0.1 A new template engine like Askama
-
A note from our sponsor - InfluxDB
www.influxdata.com | 19 Apr 2024
Index
What are some of the best open-source HTML projects in Rust? This list will help you:
Project | Stars | |
---|---|---|
1 | dioxus | 18,068 |
2 | tera | 3,210 |
3 | trunk | 3,161 |
4 | askama | 3,081 |
5 | sycamore | 2,657 |
6 | html5ever | 1,978 |
7 | maud | 1,920 |
8 | sauron | 1,913 |
9 | lol-html | 1,388 |
10 | quick-xml | 1,093 |
11 | crowbook | 684 |
12 | sauron-native | 632 |
13 | mogwai | 424 |
14 | ructe | 424 |
15 | markup.rs | 332 |
16 | horrorshow-rs | 315 |
17 | rsspls | 255 |
18 | render.rs | 223 |
19 | css-inline | 209 |
20 | syn-rsx | 176 |
21 | html5gum | 145 |
22 | nipper | 121 |
23 | ryde | 106 |