Skip to content
LIBRARYBase

Separator ​

MSeparator draws a decorative line in the theme's border color. It divides content without adding controls or repeated announcements.

Next alpha

Available in 0.1.0-alpha.4.

Web preview
Open example ↗

Usage ​

vue
<m-column>
  <m-list-item title="Design" description="Ideas taking shape." />
  <m-separator inset="md" />
  <m-list-item title="Engineering" description="Experiences that work." />
</m-column>

<m-row>
  <m-text>12 projects</m-text>
  <m-separator orientation="vertical" :length="32" spacing="md" />
  <m-text>4 people</m-text>
</m-row>

Props ​

PropTypeDefaultBehavior
orientationhorizontal | verticalhorizontalLine direction.
lengthnumberautomaticExplicit line length in DIP/px, excluding margins.
spacingspace token or numbernoneMargin on each side, perpendicular to the line.
insetspace token or numbernoneInset at each end of the line.
idstring—Optional identifier.

An automatic horizontal separator stretches within a Column's content width. An automatic vertical separator stretches within a Row's height. Use these parents without wrap for predictable axes and bounds; outside them, set length. Explicit lengths are centered. Negative and non-finite values are rejected.

spacing="sm" adds 8 DIP/px on each side in the default theme. inset="md" insets each end by 16. Horizontally, spacing affects top/bottom and inset affects left/right; vertically, the axes swap. Parent padding, these margins and any explicit length must fit in the available space.

Thickness is 1 DIP on native and 1 CSS pixel on Web, not a promise of one physical pixel. There is no content, slot, event, focus, animation or resize handle. The line is hidden from assistive output; provide headings and group structure in the app. Team uses both axes with ListItem.

Full example ​

View source
vue
<script setup lang="ts">
import { useCatalogLocale } from '../locale'
import { computed, ref } from 'vue'
import { useMavisTheme } from '@getcortexlabs/mavis-core/vue'

const { t, locale } = useCatalogLocale(() => props.lang)

const props = withDefaults(defineProps<{ lang?: 'en' | 'pt' }>(), { lang: undefined })

const pt = computed(() => (props.lang ?? locale.value) === 'pt')
const { theme } = useMavisTheme()
const vertical = ref(false)
</script>

<template>
  <m-column gap="lg">
    <m-column padding="lg" gap="md" radius="lg" :backgroundColor="theme.colors.primarySoft">
      <m-text variant="overline" tone="primary">{{
        t(pt ? 'ESPAÇO PARA RESPIRAR' : 'ROOM TO BREATHE')
      }}</m-text>
      <m-text variant="title">{{
        t(pt ? 'Uma pausa entre ideias.' : 'A pause between ideas.')
      }}</m-text>
      <m-text tone="muted">{{
        t(pt ? 'Divisões discretas. Hierarquia clara.' : 'Quiet divisions. Clear hierarchy.')
      }}</m-text>
    </m-column>
    <m-card gap="sm">
      <m-text variant="heading">{{ t(pt ? 'O que importa' : 'What matters') }}</m-text>
      <m-text tone="muted">{{ t(pt ? 'Um bom começo.' : 'A good beginning.') }}</m-text>
      <m-separator id="separator-horizontal" spacing="sm" inset="sm" />
      <m-text tone="muted">{{
        t(pt ? 'E espaço para o que vem depois.' : 'And room for what comes next.')
      }}</m-text>
    </m-card>
    <m-card>
      <m-row :height="72" justify="center">
        <m-column gap="xs" :width="0" :grow="1" align="center">
          <m-text variant="heading">12</m-text
          ><m-text variant="caption" tone="muted">{{ t(pt ? 'Projetos' : 'Projects') }}</m-text>
        </m-column>
        <m-separator id="separator-vertical" orientation="vertical" spacing="md" inset="sm" />
        <m-column gap="xs" :width="0" :grow="1" align="center">
          <m-text variant="heading">4</m-text
          ><m-text variant="caption" tone="muted">{{ t(pt ? 'Pessoas' : 'People') }}</m-text>
        </m-column>
      </m-row>
    </m-card>
    <m-card gap="md">
      <m-row justify="center" align="center" :height="104">
        <m-separator
          id="separator-changing"
          :orientation="vertical ? 'vertical' : 'horizontal'"
          :length="80"
        />
      </m-row>
      <m-button variant="secondary" @click="vertical = !vertical">{{
        t(pt ? 'Alternar orientação' : 'Change orientation')
      }}</m-button>
    </m-card>
  </m-column>
</template>

A labelled divider ​

Keep the decorative rules separate from the readable label. This shared recipe also appears in the Morrow sign-in example.

vue
<m-row gap="md" align="center">
  <m-box :grow="1" :width="0" :accessibilityHidden="true"><m-separator /></m-box>
  <m-text variant="caption" tone="muted">or continue with</m-text>
  <m-box :grow="1" :width="0" :accessibilityHidden="true"><m-separator /></m-box>
</m-row>

Desktop ​

The desktop hosts draw a one-point line in the theme's border colour, across a column or down a row, with length, spacing and inset as on the other hosts. It is decorative and hidden from assistive technology. See Desktop components.

Components for NativeScript and Web. Starting with Vue.