Skip to main content

Center

Center aligns items vertically & horizontally center.

Vector icon

Usage


import { Box, Center } from '@/components';
import theme from '@/theme';
import React from 'react';
import { StyleSheet } from 'react-native';

const Example = () => {
return (
<Center width={theme.sizes.width} height={theme.sizes.width}>
<Box width={100} height={100} bg="primary300" borderRadius="rounded-sm" />
</Center>
);
};

export default Example;

Props

Extends SpacingShorthandProps<Theme> & LayoutProps<Theme> from the theme

children

Type: React.ReactNode