#dioxus #head #component #document #elements #place #style


Small Dioxus component which allows you to place elements in the head of your document

8 releases

0.2.4 Sep 1, 2022
0.2.3 Aug 30, 2022
0.1.3 Aug 29, 2022
0.1.2 May 23, 2022

#16 in #place

Download history 27/week @ 2024-02-19 14/week @ 2024-02-26 25/week @ 2024-03-11 141/week @ 2024-04-01

166 downloads per month

MIT license

137 lines


Crates.io version


Inspired by react-helmet, this small Dioxus component allows you to place elements in the head of your code.


Add the package as a dependency to your Cargo.toml.

cargo add dioxus-helmet


Import it in your code:

use dioxus_helmet::Helmet;

Then use it as a component like this:

fn HeadElements(cx: Scope, path: String) -> Element {
    cx.render(rsx! {
        Helmet {
            link { rel: "icon", href: "{path}"}
            title { "Helmet" }
            style {
                    body {
                        color: blue;
                    a {
                        color: red;

Reach your dynamic values down as owned properties (eg String and not &'a str).

Also make sure that there are no states in your component where you use Helmet.

Any children passed to the helmet component will then be placed in the <head></head> of your document.

They will be visible while the component is rendered. Duplicates won't get appended multiple times.


This project is licensed under the MIT license.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in dioxus-helmet by you, shall be licensed as MIT, without any additional terms or conditions.


~283K SLoC