diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index 82908f88..9ec5426e 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -110,6 +110,19 @@ macro_rules! stack { ); } +/// Creates a [`Grid`] with the given children. +/// +/// [`Grid`]: crate::Grid +#[macro_export] +macro_rules! grid { + () => ( + $crate::Grid::new() + ); + ($($x:expr),+ $(,)?) => ( + $crate::Grid::with_children([$($crate::core::Element::from($x)),+]) + ); +} + /// Creates a new [`Text`] widget with the provided content. /// /// [`Text`]: core::widget::Text