leptos_meta

Function Style

source
pub fn Style(props: StyleProps) -> impl IntoView
Expand description

Injects an HTMLStyleElement 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>
        <Style>
          "body { font-weight: bold; }"
        </Style>
      </main>
    }
}

§Optional Props

  • id: [impl Into<Oco<'static, str>>](Oco<’static, str>)
    • An ID for the <script> tag.
  • media: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • nonce: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • title: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • blocking: [impl Into<Oco<'static, str>>](Oco<’static, str>)
  • children: Children
    • The content of the <style> tag.