In the previous exercise we learned how to manage whitespace around our primitives. Now it's time to use what we learned and create an application specific component.
Using Box and Flex components we can create really complex layouts without writing custom CSS. And since the values for the spacing are coming from our spacing scale we can be sure our layouts are consistent across the whole application.
Let’s create a login form four our app.
import LoginForm from './final/LoginForm';
<LoginForm/>- Create a
LoginFormcomponent. - Use only primitives for layout, whitespace (
Box,Flex,Grid, andStack) and text (Text,Heading,Button, andLink). - The layout should be responsive and the labels should be placed above input fields on a narrow screen.
Hint: Use arrays for responsiveness, like this: gridTemplateColumns={['1fr', '1fr auto']}.