Function leptos_meta::Stylesheet

source ·
pub fn Stylesheet(props: StylesheetProps) -> impl IntoView
Expand description

Injects an HTMLLinkElement into the document head that loads a stylesheet from the URL given by the href property.

use leptos::*;
use leptos_meta::*;

#[component]
fn MyApp() -> impl IntoView {
    provide_meta_context();

    view! {
      <main>
        <Stylesheet href="/style.css"/>
      </main>
    }
}

§Required Props

§Optional Props

  • id: impl Into<String>
    • An ID for the stylesheet.
  • attrs: [Vec<(&'static str, Attribute)>]
    • Custom attributes.