pub struct Column { /* private fields */ }Expand description
Lays its children out top to bottom, like a CSS flexbox column.
gap, padding, align and justify change the layout. Each
takes a value or a closure.
Implementations§
Source§impl Column
impl Column
Sourcepub fn gap(self, gap: impl IntoProp<u32>) -> Self
pub fn gap(self, gap: impl IntoProp<u32>) -> Self
Sets the space between children in logical pixels.
Sourcepub fn padding(
self,
vertical: impl IntoProp<u32>,
horizontal: impl IntoProp<u32>,
) -> Self
pub fn padding( self, vertical: impl IntoProp<u32>, horizontal: impl IntoProp<u32>, ) -> Self
Sets the padding: vertical above and below, horizontal
left and right, in logical pixels. It wins over the padding
of the container’s Style.
Sourcepub fn align(self, align: impl IntoProp<Align>) -> Self
pub fn align(self, align: impl IntoProp<Align>) -> Self
Sets how children are placed across the direction.
Sourcepub fn justify(self, justify: impl IntoProp<Justify>) -> Self
pub fn justify(self, justify: impl IntoProp<Justify>) -> Self
Sets how children are placed along the direction.
Sourcepub fn children_keyed<T, K, W>(
self,
items: impl FnMut() -> Vec<T> + 'static,
key: impl FnMut(&T) -> K + 'static,
view: impl FnMut(&Cx, Memo<T>) -> W + 'static,
) -> Self
pub fn children_keyed<T, K, W>( self, items: impl FnMut() -> Vec<T> + 'static, key: impl FnMut(&T) -> K + 'static, view: impl FnMut(&Cx, Memo<T>) -> W + 'static, ) -> Self
Adds one child per item, after the children added so far.
items runs in an effect, so the list updates when a signal it
read changes. key names each item. view builds the child for
a key the first time it appears, and that child is kept while
its key stays in the list, even if it moves. view receives the
item’s Cx and a Memo that updates when that item’s value
changes. When a key leaves the list, its child and everything
created in view are freed. If two items share a key, only the
first is shown and the duplicate is logged.