A simple semantic layout for react-native.
yarn add react-native-simple-layout
npm i react-native-simple-layout
function RectList() {
return (
<>
<Rect text={1} style={{ backgroundColor: 'red' }} />
<Rect text={2} style={{ backgroundColor: 'green' }} />
<Rect text={3} style={{ backgroundColor: 'blue' }} />
</>
);
}
import { Row } from 'react-native-simple-layout';
function RowExample() {
return (
<Row>
<RectList />
</Row>
);
}
import { Column } from 'react-native-simple-layout';
function ColumnExample() {
return (
<Column>
<RectList />
</Column>
);
}
import { Row, Stack } from 'react-native-simple-layout';
function StackExample() {
return (
<Row>
<Rect text={1} />
<Stack style={{ left: 30, top: 30 }}>
<Rect text={2} style={{ backgroundColor: 'green' }} />
<Stack style={{ left: 30, top: 30 }}>
<Rect text={3} style={{ backgroundColor: 'blue' }} />
</Stack>
</Stack>
</Row>
);
}