Function leptos_meta::Html

source ·
pub fn Html(cx: Scope, 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(cx: Scope) -> impl IntoView {
    provide_meta_context(cx);
    view! { cx,
      <main>
        <Html
          lang="he"
          dir="rtl"
          // arbitrary additional attributes can be passed via `attributes`
          attributes=AdditionalAttributes::from(vec![("data-theme", "dark")])
        />
      </main>
    }
}

Required Props

  • cx: [Scope]

Optional Props