Flex grid with either 1 column or 2 columns

162 Views Asked by At

I have a design spec that looks like this:

enter image description here

As you can see, the container can either have a row of 2 columns or a row of 1 column. The row with 2 columns also has a space between.

Using flex, how can I make this possible? The columns comprise of simple hardcoded <View>s.

1

There are 1 best solutions below

0
MichaelLearner On

You should probably use inine-flex here if you don't want to use grid. Maybe this solution will help you: Sandbox