React Native MantineLayout

Space

Add consistent spacing between elements

Import: import { Space } from 'react-native-mantine';

Usage

import { Space, Text , Badge } from 'react-native-mantine';

// Vertical spacing
<Text>First element</Text>
<Space h="md" />
<Text>Second element</Text>

// Horizontal spacing
<View style={{ flexDirection: 'row' }}>
  <Badge>Item 1</Badge>
  <Space w="lg" />
  <Badge>Item 2</Badge>
</View>

// Custom spacing
<Space h={50} />
<Space w={100} />

Props

PropTypeDefaultDescription
w'xs' | 'sm' | 'md' | 'lg' | 'xl' | numberWidth - key of theme.spacing or number for width in px
h'xs' | 'sm' | 'md' | 'lg' | 'xl' | numberHeight - key of theme.spacing or number for height in px
styleViewStyleAdditional styles to apply to the space element
pstring | numberPadding on all sides (inherited from BoxView)
pxstring | numberPadding horizontal (inherited from BoxView)
pystring | numberPadding vertical (inherited from BoxView)
ptstring | numberPadding top (inherited from BoxView)
pbstring | numberPadding bottom (inherited from BoxView)
plstring | numberPadding left (inherited from BoxView)
prstring | numberPadding right (inherited from BoxView)
mstring | numberMargin on all sides (inherited from BoxView)
mxstring | numberMargin horizontal (inherited from BoxView)
mystring | numberMargin vertical (inherited from BoxView)
mtstring | numberMargin top (inherited from BoxView)
mbstring | numberMargin bottom (inherited from BoxView)
mlstring | numberMargin left (inherited from BoxView)
mrstring | numberMargin right (inherited from BoxView)

Source on GitHub · npm