Function leptos_meta::Html

source ·
pub fn Html(props: HtmlProps) -> impl IntoView
Expand description

A component to set metadata on the document’s <html> element from within the application.

use leptos::*;
use leptos_meta::*;

#[component]
fn MyApp() -> impl IntoView {
    provide_meta_context();

    view! {
      <main>
        <Html
          lang="he"
          dir="rtl"
          // arbitrary additional attributes can be passed via `attr:`
          attr:data-theme="dark"
        />
      </main>
    }
}

§Required Props

  • attributes: [Vec<(&'static str, Attribute)>]
    • Arbitrary attributes to add to the <html>

§Optional Props