Add flexible spacing between elements
The Spacer
component allows you to add customizable vertical or horizontal space between elements in your document.
Use the Spacer
component to create gaps between content. You can specify either height
or width
.
Vertical space the spacer takes up. Use a number for pixels, a string for other units, or true
for 100%.
Horizontal space the spacer takes up. Use a number for pixels, a string for other units, or true
for 100%.
CSS display property of the spacer.
The Spacer
component serves a similar purpose to LaTeX’s vertical and horizontal spacing commands:
Spacer
with height
is similar to LaTeX’s \vspace{}
Spacer
with width
is similar to LaTeX’s \hspace{}
However, Spacer
offers more flexibility:
Spacer
can use any CSS unit.Spacer
can adapt to different screen sizes more easily.Spacer
uses a single component for both vertical and horizontal spacing.