Function leptos_meta::Link

source ·
pub fn Link(cx: Scope, 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(cx: Scope) -> impl IntoView {
    provide_meta_context(cx);

    view! { cx,
      <main>
        <Link rel="preload"
          href="myFont.woff2"
          as_="font"
          type_="font/woff2"
          crossorigin="anonymous"
        />
      </main>
    }
}

Required Props

  • cx: [Scope]

Optional Props