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
- lang:
impl Into<TextProp>
- The
lang
attribute on the<html>
.
- The
- dir:
impl Into<TextProp>
- The
dir
attribute on the<html>
.
- The
- class:
impl Into<TextProp>
- The
class
attribute on the<html>
.
- The
- attributes:
impl Into<MaybeSignal<AdditionalAttributes>>
- Arbitrary attributes to add to the
<html>
- Arbitrary attributes to add to the