Struct leptos_meta::LinkProps
source · pub struct LinkProps {Show 18 fields
pub id: Option<Cow<'static, str>>,
pub as_: Option<Cow<'static, str>>,
pub crossorigin: Option<Cow<'static, str>>,
pub disabled: Option<bool>,
pub fetchpriority: Option<Cow<'static, str>>,
pub href: Option<Cow<'static, str>>,
pub hreflang: Option<Cow<'static, str>>,
pub imagesizes: Option<Cow<'static, str>>,
pub imagesrcset: Option<Cow<'static, str>>,
pub integrity: Option<Cow<'static, str>>,
pub media: Option<Cow<'static, str>>,
pub prefetch: Option<Cow<'static, str>>,
pub referrerpolicy: Option<Cow<'static, str>>,
pub rel: Option<Cow<'static, str>>,
pub sizes: Option<Cow<'static, str>>,
pub title: Option<Cow<'static, str>>,
pub type_: Option<Cow<'static, str>>,
pub blocking: Option<Cow<'static, str>>,
}
Expand description
Props for the Link
component.
Injects an HTMLLinkElement into the document head, accepting any of the valid attributes for that tag.
use leptos::*;
use leptos_meta::*;
#[component]
fn MyApp(cx: Scope) -> impl IntoView {
provide_meta_context(cx);
view! { cx,
<main>
<Link rel="preload"
href="myFont.woff2"
as_="font"
type_="font/woff2"
crossorigin="anonymous"
/>
</main>
}
}
Required Props
- cx: [
Scope
]
Optional Props
- id: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
id
attribute.
- The
- as_: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
as
attribute.
- The
- crossorigin: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
crossorigin
attribute.
- The
- disabled:
impl Into<bool>
- The
disabled
attribute.
- The
- fetchpriority: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
fetchpriority
attribute.
- The
- href: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
href
attribute.
- The
- hreflang: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
hreflang
attribute.
- The
- imagesizes: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
imagesizes
attribute.
- The
- imagesrcset: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
imagesrcset
attribute.
- The
- integrity: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
integrity
attribute.
- The
- media: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
media
attribute.
- The
- prefetch: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
prefetch
attribute.
- The
- referrerpolicy: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
referrerpolicy
attribute.
- The
- rel: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
rel
attribute.
- The
- sizes: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
sizes
attribute.
- The
- title: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
title
attribute.
- The
- type_: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
type
attribute.
- The
- blocking: [
impl Into<Cow<'static, str>>
](Cow<’static, str>)- The
blocking
attribute.
- The
Fields§
§id: Option<Cow<'static, str>>
The id
attribute.
as_: Option<Cow<'static, str>>
The as
attribute.
crossorigin: Option<Cow<'static, str>>
The crossorigin
attribute.
disabled: Option<bool>
The disabled
attribute.
fetchpriority: Option<Cow<'static, str>>
The fetchpriority
attribute.
href: Option<Cow<'static, str>>
The href
attribute.
hreflang: Option<Cow<'static, str>>
The hreflang
attribute.
imagesizes: Option<Cow<'static, str>>
The imagesizes
attribute.
imagesrcset: Option<Cow<'static, str>>
The imagesrcset
attribute.
integrity: Option<Cow<'static, str>>
The integrity
attribute.
media: Option<Cow<'static, str>>
The media
attribute.
prefetch: Option<Cow<'static, str>>
The prefetch
attribute.
referrerpolicy: Option<Cow<'static, str>>
The referrerpolicy
attribute.
rel: Option<Cow<'static, str>>
The rel
attribute.
sizes: Option<Cow<'static, str>>
The sizes
attribute.
title: Option<Cow<'static, str>>
The title
attribute.
type_: Option<Cow<'static, str>>
The type
attribute.
blocking: Option<Cow<'static, str>>
The blocking
attribute.
Implementations§
source§impl LinkProps
impl LinkProps
sourcepub fn builder(
) -> LinkPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder( ) -> LinkPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building LinkProps
.
On the builder, call .id(...)
(optional), .as_(...)
(optional), .crossorigin(...)
(optional), .disabled(...)
(optional), .fetchpriority(...)
(optional), .href(...)
(optional), .hreflang(...)
(optional), .imagesizes(...)
(optional), .imagesrcset(...)
(optional), .integrity(...)
(optional), .media(...)
(optional), .prefetch(...)
(optional), .referrerpolicy(...)
(optional), .rel(...)
(optional), .sizes(...)
(optional), .title(...)
(optional), .type_(...)
(optional), .blocking(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of LinkProps
.