Struct leptos_meta::HtmlProps
source · pub struct HtmlProps {
pub lang: Option<TextProp>,
pub dir: Option<TextProp>,
pub class: Option<TextProp>,
pub attributes: Option<MaybeSignal<AdditionalAttributes>>,
}
Expand description
Props for the Html
component.
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
Fields§
§lang: Option<TextProp>
The lang
attribute on the <html>
.
dir: Option<TextProp>
The dir
attribute on the <html>
.
class: Option<TextProp>
The class
attribute on the <html>
.
attributes: Option<MaybeSignal<AdditionalAttributes>>
Arbitrary attributes to add to the <html>
Implementations§
source§impl HtmlProps
impl HtmlProps
sourcepub fn builder() -> HtmlPropsBuilder<((), (), (), ())>
pub fn builder() -> HtmlPropsBuilder<((), (), (), ())>
Create a builder for building HtmlProps
.
On the builder, call .lang(...)
(optional), .dir(...)
(optional), .class(...)
(optional), .attributes(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of HtmlProps
.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for HtmlProps
impl !Send for HtmlProps
impl !Sync for HtmlProps
impl Unpin for HtmlProps
impl !UnwindSafe for HtmlProps
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more