Components
Spacer
Add flexible spacing between elements
The Spacer
component allows you to add customizable vertical or horizontal space between elements in your document.
Usage
Use the Spacer
component to create gaps between content. You can specify either height
or width
.
Props
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.
Comparison to LaTeX
The Spacer
component serves a similar purpose to LaTeX’s vertical and horizontal spacing commands:
Spacer
withheight
is similar to LaTeX’s\vspace{}
Spacer
withwidth
is similar to LaTeX’s\hspace{}
However, Spacer
offers more flexibility:
- Units: While LaTeX typically uses pt, em, or ex,
Spacer
can use any CSS unit. - Responsiveness:
Spacer
can adapt to different screen sizes more easily. - Simplicity:
Spacer
uses a single component for both vertical and horizontal spacing.