Struct leptos_meta::StylesheetProps
source · pub struct StylesheetProps {
pub href: String,
pub id: Option<String>,
pub attrs: Vec<(&'static str, Attribute)>,
}
Expand description
Props for the Stylesheet
component.
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
- href:
impl Into<String>
- The URL at which the stylesheet is located.
Optional Props
- id:
impl Into<String>
- An ID for the stylesheet.
- attrs: [
Vec<(&'static str, Attribute)>
]- Custom attributes.
Fields§
§href: String
The URL at which the stylesheet is located.
id: Option<String>
An ID for the stylesheet.
attrs: Vec<(&'static str, Attribute)>
Custom attributes.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StylesheetProps
impl !Send for StylesheetProps
impl !Sync for StylesheetProps
impl Unpin for StylesheetProps
impl !UnwindSafe for StylesheetProps
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more