Struct leptos_meta::LinkProps

source ·
pub struct LinkProps {
Show 19 fields pub id: Option<Oco<'static, str>>, pub as_: Option<Oco<'static, str>>, pub crossorigin: Option<Oco<'static, str>>, pub disabled: Option<bool>, 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 prefetch: 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>>, pub attrs: Vec<(&'static str, Attribute)>,
}
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() -> 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>)
  • disabled: impl Into<bool>
  • 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>)
  • prefetch: [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>)
  • attrs: [Vec<(&'static str, Attribute)>]
    • Custom attributes.

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.

§disabled: Option<bool>

The disabled 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.

§prefetch: Option<Oco<'static, str>>

The prefetch 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.

§attrs: Vec<(&'static str, Attribute)>

Custom attributes.

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), .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), .attrs(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of LinkProps.

Trait Implementations§

source§

impl IntoView for LinkProps

source§

fn into_view(self) -> View

Converts the value into View.

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more