Struct leptos_meta::MetaProps
source · pub struct MetaProps {
pub charset: Option<TextProp>,
pub name: Option<TextProp>,
pub property: Option<TextProp>,
pub http_equiv: Option<TextProp>,
pub content: Option<TextProp>,
}
Expand description
Props for the Meta
component.
Injects an HTMLMetaElement into the document head to set metadata
use leptos::*;
use leptos_meta::*;
#[component]
fn MyApp(cx: Scope) -> impl IntoView {
provide_meta_context(cx);
view! { cx,
<main>
<Meta charset="utf-8"/>
<Meta name="description" content="A Leptos fan site."/>
<Meta http_equiv="refresh" content="3;url=https://github.com/leptos-rs/leptos"/>
</main>
}
}
Required Props
- cx: [
Scope
]
Optional Props
- charset:
impl Into<TextProp>
- The
charset
attribute.
- The
- name:
impl Into<TextProp>
- The
name
attribute.
- The
- property:
impl Into<TextProp>
- The
property
attribute.
- The
- http_equiv:
impl Into<TextProp>
- The
http-equiv
attribute.
- The
- content:
impl Into<TextProp>
- The
content
attribute.
- The
Fields§
§charset: Option<TextProp>
The charset
attribute.
name: Option<TextProp>
The name
attribute.
property: Option<TextProp>
The property
attribute.
http_equiv: Option<TextProp>
The http-equiv
attribute.
content: Option<TextProp>
The content
attribute.
Implementations§
source§impl MetaProps
impl MetaProps
sourcepub fn builder() -> MetaPropsBuilder<((), (), (), (), ())>
pub fn builder() -> MetaPropsBuilder<((), (), (), (), ())>
Create a builder for building MetaProps
.
On the builder, call .charset(...)
(optional), .name(...)
(optional), .property(...)
(optional), .http_equiv(...)
(optional), .content(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of MetaProps
.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MetaProps
impl !Send for MetaProps
impl !Sync for MetaProps
impl Unpin for MetaProps
impl !UnwindSafe for MetaProps
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