Trait patternfly_yew::core::WithBreakpointExt
source · pub trait WithBreakpointExt<T>: Sizedwhere
T: PartialEq,{
// Required method
fn on(self, breakpoint: Breakpoint) -> WithBreakpoint<T>;
// Provided methods
fn all(self) -> WithBreakpoint<T> { ... }
fn sm(self) -> WithBreakpoint<T> { ... }
fn md(self) -> WithBreakpoint<T> { ... }
fn lg(self) -> WithBreakpoint<T> { ... }
fn xl(self) -> WithBreakpoint<T> { ... }
fn xxl(self) -> WithBreakpoint<T> { ... }
}
Expand description
Helps creating WithBreakpoint
instances.
§Example
The following example populates the cols
attribute of a GridItem
. I requires a number of
columns to span, which can be specified for the different breakpoints.
use yew::prelude::*;
use patternfly_yew::prelude::*;
#[function_component(Example)]
fn example() -> Html {
html!(
<Grid>
<GridItem cols={[4.all(), 8.lg()]}>{"cell"}</GridItem>
</Grid>
)
}
Required Methods§
fn on(self, breakpoint: Breakpoint) -> WithBreakpoint<T>
Provided Methods§
fn all(self) -> WithBreakpoint<T>
fn sm(self) -> WithBreakpoint<T>
fn md(self) -> WithBreakpoint<T>
fn lg(self) -> WithBreakpoint<T>
fn xl(self) -> WithBreakpoint<T>
fn xxl(self) -> WithBreakpoint<T>
Object Safety§
This trait is not object safe.