Row
m-row · Arrange elements side by side with spacing and alignment.
Usage
vue
<m-row gap="sm" align="center">
<m-button :grow="1">Continue</m-button>
<m-button variant="ghost">Cancel</m-button>
</m-row>API
| Prop | Type | Default | Purpose |
|---|---|---|---|
gap | token / number | none | Space between children. |
align | start / center / end / stretch | center | Cross-axis alignment. |
justify | start / center / end / between / around | start | Horizontal distribution. |
wrap | boolean | false | Allows multiple lines. |
grow belongs to the child that should fill available space. Mavis children in a Row can shrink in width to fit; use shrink to adjust that behavior. Enable wrap when items should move onto another line.
Composition props
padding, paddingX, paddingY, radius, grow, shrink, width, height and backgroundColor are also accepted. paddingX and paddingY override their respective sides. Row, Column and Box start without padding; Card starts at lg. grow defaults to 0; shrink follows the parent context.
Full example
This file also runs in the NativeScript catalog and the Web preview.
View source
vue
<script setup lang="ts">
import { useCatalogLocale } from '../locale'
import { ref } from 'vue'
import { useMavisTheme } from '@getcortexlabs/mavis-core/vue'
import type { Space } from '@getcortexlabs/mavis-core'
const { t } = useCatalogLocale()
withDefaults(defineProps<{ lang?: 'en' | 'pt' }>(), { lang: 'pt' })
const { theme } = useMavisTheme()
const gaps: Space[] = ['sm', 'md', 'lg']
const selected = ref(1)
</script>
<template>
<m-column gap="lg">
<m-row :gap="gaps[selected]">
<m-column
v-for="label in ['A', 'B', 'C']"
:key="label"
:grow="1"
padding="md"
radius="sm"
:backgroundColor="theme.colors.elevated"
>
<m-text align="center" tone="primary">{{ t(label) }}</m-text>
</m-column>
</m-row>
<m-button variant="secondary" @click="selected = (selected + 1) % gaps.length"
>{{ t('Espaço: ') }}{{ t(gaps[selected]) }}</m-button
>
</m-column>
</template>In context
See the components in a complete vehicle controls screen.
See Layout and text for flexible sizing, large text and RTL direction.