zino_dioxus/layout/
columns.rsuse crate::class::Class;
use dioxus::prelude::*;
pub fn Columns(props: ColumnsProps) -> Element {
rsx! {
div {
class: "{props.class}",
class: if props.multiline { "is-multiline" },
class: if let Some(gap) = props.gap { "is-variable is-{gap}" },
for column in props.columns.iter() {
div {
class: "{props.column_class}",
class: if let Some(size) = props.size { "is-{size}" },
class: if let Some(offset) = props.offset { "is-offset-{offset}" },
{ column }
}
}
}
}
}
#[derive(Clone, PartialEq, Props)]
pub struct ColumnsProps {
#[props(into, default = "columns")]
pub class: Class,
#[props(into, default = "column")]
pub column_class: Class,
#[props(into)]
pub size: Option<u8>,
#[props(into)]
pub offset: Option<u8>,
#[props(into)]
pub gap: Option<u8>,
#[props(default)]
pub multiline: bool,
#[props(into)]
pub columns: Vec<Element>,
}