Skip to main content

div

Function div 

Source
pub fn div() -> Div
Expand description

Creates an empty Div element, which you style and fill with children.

Chain styling, event handlers and children onto the result. The element does nothing until it is returned from a render method or passed to a parent.

ยงExample

let card = div()
    .flex()
    .flex_col()
    .gap_2()
    .p_3()
    .bg(rgb(0xffffff))
    .child("Title")
    .child("Body");