Struct leptos_meta::HtmlProps
source · pub struct HtmlProps {
pub lang: Option<TextProp>,
pub dir: Option<TextProp>,
pub class: Option<TextProp>,
pub attributes: Vec<(&'static str, Attribute)>,
}
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() -> 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>
- Arbitrary attributes to add to the
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
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: Vec<(&'static str, Attribute)>
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