pub struct LinkProps {Show 16 fields
pub id: Option<Oco<'static, str>>,
pub as_: Option<Oco<'static, str>>,
pub crossorigin: Option<Oco<'static, str>>,
pub fetchpriority: Option<Oco<'static, str>>,
pub href: Option<Oco<'static, str>>,
pub hreflang: Option<Oco<'static, str>>,
pub imagesizes: Option<Oco<'static, str>>,
pub imagesrcset: Option<Oco<'static, str>>,
pub integrity: Option<Oco<'static, str>>,
pub media: Option<Oco<'static, str>>,
pub referrerpolicy: Option<Oco<'static, str>>,
pub rel: Option<Oco<'static, str>>,
pub sizes: Option<Oco<'static, str>>,
pub title: Option<Oco<'static, str>>,
pub type_: Option<Oco<'static, str>>,
pub blocking: Option<Oco<'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::prelude::*;
use leptos_meta::*;
#[component]
fn MyApp() -> impl IntoView {
provide_meta_context();
view! {
<main>
<Link rel="preload"
href="myFont.woff2"
as_="font"
type_="font/woff2"
crossorigin="anonymous"
/>
</main>
}
}
§Optional Props
- id: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
id
attribute.
- The
- as_: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
as
attribute.
- The
- crossorigin: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
crossorigin
attribute.
- The
- fetchpriority: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
fetchpriority
attribute.
- The
- href: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
href
attribute.
- The
- hreflang: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
hreflang
attribute.
- The
- imagesizes: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
imagesizes
attribute.
- The
- imagesrcset: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
imagesrcset
attribute.
- The
- integrity: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
integrity
attribute.
- The
- media: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
media
attribute.
- The
- referrerpolicy: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
referrerpolicy
attribute.
- The
- rel: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
rel
attribute.
- The
- sizes: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
sizes
attribute.
- The
- title: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
title
attribute.
- The
- type_: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
type
attribute.
- The
- blocking: [
impl Into<Oco<'static, str>>
](Oco<’static, str>)- The
blocking
attribute.
- The
Fields§
§id: Option<Oco<'static, str>>
The id
attribute.
as_: Option<Oco<'static, str>>
The as
attribute.
crossorigin: Option<Oco<'static, str>>
The crossorigin
attribute.
fetchpriority: Option<Oco<'static, str>>
The fetchpriority
attribute.
href: Option<Oco<'static, str>>
The href
attribute.
hreflang: Option<Oco<'static, str>>
The hreflang
attribute.
imagesizes: Option<Oco<'static, str>>
The imagesizes
attribute.
imagesrcset: Option<Oco<'static, str>>
The imagesrcset
attribute.
integrity: Option<Oco<'static, str>>
The integrity
attribute.
media: Option<Oco<'static, str>>
The media
attribute.
referrerpolicy: Option<Oco<'static, str>>
The referrerpolicy
attribute.
rel: Option<Oco<'static, str>>
The rel
attribute.
sizes: Option<Oco<'static, str>>
The sizes
attribute.
title: Option<Oco<'static, str>>
The title
attribute.
type_: Option<Oco<'static, str>>
The type
attribute.
blocking: Option<Oco<'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), .fetchpriority(...)
(optional), .href(...)
(optional), .hreflang(...)
(optional), .imagesizes(...)
(optional), .imagesrcset(...)
(optional), .integrity(...)
(optional), .media(...)
(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
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkProps
impl RefUnwindSafe for LinkProps
impl Send for LinkProps
impl Sync for LinkProps
impl Unpin for LinkProps
impl UnwindSafe for LinkProps
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more