Function leptos_meta::Link

source ·
pub fn Link(props: LinkProps) -> impl IntoView
Expand description

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.