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 Freeze for StylesheetProps
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more