diff --git a/widget/src/helpers.rs b/widget/src/helpers.rs index ebc6cd64..3ac126a7 100644 --- a/widget/src/helpers.rs +++ b/widget/src/helpers.rs @@ -113,6 +113,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