Struct LinkProps

Source
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.
  • as_: [impl Into<Oco<'static, str>>](Oco<’static, str>)
    • The as attribute.
  • crossorigin: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • fetchpriority: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • href: [impl Into<Oco<'static, str>>](Oco<’static, str>)
    • The href attribute.
  • hreflang: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • imagesizes: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • imagesrcset: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • integrity: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • media: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • referrerpolicy: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • rel: [impl Into<Oco<'static, str>>](Oco<’static, str>)
    • The rel attribute.
  • sizes: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • title: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • type_: [impl Into<Oco<'static, str>>](Oco<’static, str>)
    • The type attribute.
  • blocking: [impl Into<Oco<'static, str>>](Oco<’static, str>)

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

Source

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§

Source§

impl Props for LinkProps

Source§

type Builder = LinkPropsBuilder

Source§

fn builder() -> Self::Builder

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T