Skip to content

Global Properties

These properties are available in many other components and elements.

PropertyTypeDescription
spaceobject(optional) Has to be an object with either: top, right, bottom or left. Use spacing values like: small, 1rem, 1 or , 16px.
topstring
number
boolean
(optional) Use spacing values like: small, 1rem, 1 or , 16px. Will use margin-top.
rightstring
number
boolean
(optional) Use spacing values like: small, 1rem, 1 or , 16px. will use margin-right.
bottomstring
number
boolean
(optional) Use spacing values like: small, 1rem, 1 or , 16px. will use margin-bottom.
leftstring
number
boolean
(optional) Use spacing values like: small, 1rem, 1 or , 16px. will use margin-left.

Component Properties

PropertyTypeDescription
elementReact.Element(optional) defines the HTML element used. Defaults to div.
stretchboolean(optional) if set to true, then the space element will be 100% in width.
inlineboolean(optional) if set to true, then display: inline-block; is used, so the HTML elements get aligned horizontally. Defaults to false.
innerSpaceobject
string
number
boolean
(optional) Will add a padding around the content. Supports also media query breakpoints like {small: { top: 'medium' }}.
no_collapseboolean(optional) if set to true, then a wrapper with display: flow-root; is used. This way you avoid Margin Collapsing. Defaults to false. Note: You can't use inline={true} in combination.

Zero

Use either 0 or false (as a number/boolean or string) to set a margin of 0.

Provider

Also, Provider is supporting the collapse property.

Code Editor
<Provider
  space={{
    no_collapse: true,
  }}
>
  <Space>I do not collapse</Space>
  <Space>I do not collapse</Space>
</Provider>