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>,
pub attrs: Vec<(&'static str, Attribute)>,
}
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() -> impl IntoView {
provide_meta_context();
view! {
<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>
}
}
§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
- attrs: [
Vec<(&'static str, Attribute)>
]- Custom attributes.
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.
attrs: Vec<(&'static str, Attribute)>
Custom attributes.
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), .attrs(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of MetaProps
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetaProps
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