leptos_meta

Function 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::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>)