diff --git a/packages/grafana-ui/src/components/Layout/Box/Box.tsx b/packages/grafana-ui/src/components/Layout/Box/Box.tsx index 97a9f54abda..4a5a7e52e2f 100644 --- a/packages/grafana-ui/src/components/Layout/Box/Box.tsx +++ b/packages/grafana-ui/src/components/Layout/Box/Box.tsx @@ -59,6 +59,7 @@ interface BoxProps extends Omit, 'className' | shrink?: ResponsiveProp; alignItems?: ResponsiveProp; justifyContent?: ResponsiveProp; + gap?: ResponsiveProp; // Other props backgroundColor?: ResponsiveProp; @@ -96,6 +97,7 @@ export const Box = forwardRef>((props, alignItems, boxShadow, element, + gap, ...rest } = props; const styles = useStyles2( @@ -123,7 +125,8 @@ export const Box = forwardRef>((props, borderRadius, justifyContent, alignItems, - boxShadow + boxShadow, + gap ); const Element = element ?? 'div'; @@ -185,7 +188,8 @@ const getStyles = ( borderRadius: BoxProps['borderRadius'], justifyContent: BoxProps['justifyContent'], alignItems: BoxProps['alignItems'], - boxShadow: BoxProps['boxShadow'] + boxShadow: BoxProps['boxShadow'], + gap: BoxProps['gap'] ) => { return { root: css([ @@ -268,6 +272,9 @@ const getStyles = ( getResponsiveStyle(theme, boxShadow, (val) => ({ boxShadow: theme.shadows[val], })), + getResponsiveStyle(theme, gap, (val) => ({ + gap: theme.spacing(val), + })), ]), }; };