Function leptos_meta::Stylesheet
source · pub fn Stylesheet(cx: Scope, 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(cx: Scope) -> impl IntoView {
provide_meta_context(cx);
view! { cx,
<main>
<Stylesheet href="/style.css"/>
</main>
}
}
Required Props
- cx: [
Scope
] - href:
impl Into<String>
- The URL at which the stylesheet is located.
Optional Props
- id:
impl Into<String>
- An ID for the stylesheet.