Space
Add horizontal or vertical spacing from theme
Import
Source
Docs
Package
Usage
Use Space component to add horizontal or vertical spacing between elements:
First line
Second line
H
xs
sm
md
lg
xl
First part
Second part
W
xs
sm
md
lg
xl
Where to use
In most cases, you would want to use margin props instead of Space when working with Mantine components:
But when you work with regular HTML elements you do not have access to theme.spacing
and you may want to use
Space component to skip direct theme subscription:
h and w props
h
and w
are shortcuts for height and width, you can use values from theme.spacing
(xs, sm, md, lg, xl) or number to set width or height in px:
Feedback
Your feedback is most valuable contribution to the project, please share how you use Mantine, what features are missing and what is done good
Leave feedback