Skip to main content

Spacer Ready

Spacer component is used to give additional white space between two components in an interface. You can customize the size and direction with the provided properties.

Examples #

Open in new window
<div class="spacer-demo">
<duet-spacer size="xxxx-large"></duet-spacer>
<duet-spacer size="xxx-large"></duet-spacer>
<duet-spacer size="xx-large"></duet-spacer>
<duet-spacer size="x-large"></duet-spacer>
<duet-spacer size="large"></duet-spacer>
<duet-spacer size="medium"></duet-spacer>
<duet-spacer size="small"></duet-spacer>
<duet-spacer size="x-small"></duet-spacer>
<duet-spacer size="xx-small"></duet-spacer>
</div>
Open in new window
<div class="spacer-demo">
<duet-spacer size="xxxx-large" direction="horizontal"></duet-spacer>
<duet-spacer size="xxx-large" direction="horizontal"></duet-spacer>
<duet-spacer size="xx-large" direction="horizontal"></duet-spacer>
<duet-spacer size="x-large" direction="horizontal"></duet-spacer>
<duet-spacer size="large" direction="horizontal"></duet-spacer>
<duet-spacer size="medium" direction="horizontal"></duet-spacer>
<duet-spacer size="small" direction="horizontal"></duet-spacer>
<duet-spacer size="x-small" direction="horizontal"></duet-spacer>
<duet-spacer size="xx-small" direction="horizontal"></duet-spacer>
</div>
Open in new window
<div class="spacer-demo">
<duet-spacer breakpoint="xx-large" size="xxxx-large"></duet-spacer>
<duet-spacer breakpoint="x-large" size="xxx-large"></duet-spacer>
<duet-spacer breakpoint="large" size="xx-large"></duet-spacer>
<duet-spacer breakpoint="medium" size="x-large"></duet-spacer>
<duet-spacer breakpoint="small" size="large"></duet-spacer>
<duet-spacer breakpoint="x-small" size="medium"></duet-spacer>
<duet-spacer breakpoint="xx-small" size="small"></duet-spacer>
</div>

Properties #

Property Attribute Description Type Default
breakpoint breakpoint Adjusts the breakpoint where the spacer is shown in. The functionality follows 1:1 the media queries defined in design tokens. "" | "large" | "medium" | "small" | "x-large" | "x-small" | "xx-large" | "xx-small" ""
direction direction Direction of the space added. "horizontal" | "vertical" "vertical"
size size Size variation of the spacer. Can be any of the spacing tokens. "large" | "medium" | "small" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large" | "xxxx-large" "medium"

Usage #

This section includes guidelines for designers and developers about the usage of this component in different contexts.

When to use #

  • To add additional space between two adjacent components, either horizontally or vertically.

When not to use #

  • To add more space between form components. Instead rely on the default margin="auto" setting.

Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.

Integration guidelines


Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

Usage With Markdown


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.