Skip to content

Accessibility: Not Needed

Translations: Not Needed

Space

Arrange components with consistent spacing

Basic Usage

Use Space to add spacing between elements.

Vue
html
<template>
  <HLSpace id="space-basic">
    <HLButton id="space-basic-btn-1">Item 1</HLButton>
    <HLButton id="space-basic-btn-2">Item 2</HLButton>
    <HLButton id="space-basic-btn-3">Item 3</HLButton>
  </HLSpace>
</template>
<script setup>
  import { HLSpace, HLButton } from '@platform-ui/highrise'
</script>

Vertical Layout

Set vertical prop to arrange items vertically.

Vue
html
<template>
  <HLSpace id="space-vertical" vertical>
    <HLButton id="space-vertical-btn-1">Item 1</HLButton>
    <HLButton id="space-vertical-btn-2">Item 2</HLButton>
    <HLButton id="space-vertical-btn-3">Item 3</HLButton>
  </HLSpace>
</template>
<script setup>
  import { HLSpace, HLButton } from '@platform-ui/highrise'
</script>

Custom Size

Control spacing using the size prop.


Vue
html
<template>
  <HLSpace id="space-size-small" size="xs">
    <HLButton id="space-size-small-btn-1">Small</HLButton>
    <HLButton id="space-size-small-btn-2">Spacing</HLButton>
  </HLSpace>

  <HLSpace id="space-size-large" size="lg">
    <HLButton id="space-size-large-btn-1">Large</HLButton>
    <HLButton id="space-size-large-btn-2">Spacing</HLButton>
  </HLSpace>
</template>
<script setup>
  import { HLSpace, HLButton } from '@platform-ui/highrise'
</script>

Justify Content

Control alignment using the justify prop.

Vue
html
<template>
  <HLSpace id="space-justify" justify="space-between">
    <HLButton id="space-justify-btn-1">Left</HLButton>
    <HLButton id="space-justify-btn-2">Right</HLButton>
  </HLSpace>
</template>
<script setup>
  import { HLSpace, HLButton } from '@platform-ui/highrise'
</script>

Align Items

Control alignment using the align prop.

Vue
html
<template>
  <HLSpace id="space-align" align="center">
    <HLButton id="space-align-btn-1" size="lg">Item 1</HLButton>
    <HLButton id="space-align-btn-2" size="sm">Item 2</HLButton>
    <HLButton id="space-align-btn-3" size="2xs">Item 3</HLButton>
  </HLSpace>
</template>
<script setup>
  import { HLSpace, HLButton } from '@platform-ui/highrise'
</script>

Imports

ts
import { HLSpace } from '@platform-ui/highrise'

Props

NameTypeDefaultDescription
id *string | undefinedundefinedThe id of the element
align'start' | 'end' | 'center' | 'baseline' | 'stretch' | undefinedundefinedCross axis alignment
inlinebooleanfalseWhether to render as an inline element
itemStylestring | object | undefinedundefinedStyle for space items
justify'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly''start'Main axis alignment
size'xs' | 'sm' | 'md' | 'lg' | '2xs' | '3xs' | number | [number, number]'md'Space size
verticalbooleanfalseWhether to lay out elements vertically
wrapbooleantrueWhether to wrap elements

Slots

NameParametersDescription
default()The content to be spaced