pub struct Stack { /* private fields */ }Expand description
Children in a column (or a row) with even spacing.
let html = render_static(Stack![row = true, gap = 4, align = Align::Center, "a", "b"]);
assert!(html.ends_with(r#"<div class="nr-stack nr-stack-row nr-gap-4 nr-items-center">ab</div>"#));Implementations§
Source§impl Stack
impl Stack
pub fn new() -> Self
Sourcepub fn class(self, v: impl Into<String>) -> Self
pub fn class(self, v: impl Into<String>) -> Self
Extra classes for the outer element. They win over the defaults.
Sourcepub fn with(self, part: impl Part) -> Self
pub fn with(self, part: impl Part) -> Self
Add an attribute (class(..), id(..), aria(..), …) or a child.
Sourcepub fn gap(self, v: u8) -> Self
pub fn gap(self, v: u8) -> Self
Space between children, in quarters of a rem (4 = 1rem). Default 4.
pub fn align(self, v: Align) -> Self
pub fn justify(self, v: Justify) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Stack
impl !Sync for Stack
impl !UnwindSafe for Stack
impl Forget for Stack
impl Freeze for Stack
impl Move for Stack
impl Send for Stack
impl Unpin for Stack
impl UnsafeUnpin for Stack
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