Composing Layouts in React
In this course we show you how to build complex layouts in React by composing just a few foundational layout primitives. Along the way you will learn modern CSS Layout tools like Normal Flow, Flexbox, and Grid.
- 4.9 / 5 (10 ratings)
- Published
- Updated
4 hrs 52 mins
25 Videos
Travis Waith-Mair
š Hi! I'm Travis Waith-Mair. I am a senior front-end developer and the creator of the Bedrock Layout Primitives, https://bedrock-layout.dev/, a library of components designed to make layout composition easier.
I am also the author of The newline Guide to Composing Layouts in React here at newline.
01Remote
You can take the course from anywhere in the world, as long as you have a computer and an internet connection.
02Self-Paced
Learn at your own pace, whenever it's convenient for you. With no rigid schedule to worry about, you can take the course on your own terms.
03Community
Join a vibrant community of other students who are also learning with Composing Layouts in React. Ask questions, get feedback and collaborate with others to take your skills to the next level.
04Structured
Learn in a cohesive fashion that's easy to follow. With a clear progression from basic principles to advanced techniques, you'll grow stronger and more skilled with each module.
What it means to compose layouts and why you should do it
How to apply the principles of Encapsualted CSS in our React components
The foundational layout primitives that every developer should know
CSS layout has grown and evolved into a robust set of tools to accomplish some fantastic modern layouts. The problem is that we are still teaching CSS as something that is" hacked" together by using" tricks" to get our desired web layouts. Learning CSS like this typically leads us down one of two paths: We either build fragile page layouts using the "see what sticks" method of CSS, or we give up and declare that CSS is too tricky and bring in an X column grid system like Twitter Bootstrap.
Creating page layouts in CSS doesn't have to be complicated. Like how you make much of your everyday speech using just a small subset of vocabulary composed together, you can achieve sophisticated layouts by composing simple low-level layout primitives in unique ways.
In this course, you will learn foundational layout primitives that you can use to build many of your more complex layouts. You will also learn how to apply the principle of "Encapsulated CSS" to both extend these primitives as well as to create custom layout primitives. To do this, we will recreate many of the layouts found in the wild using the principles mentioned above.
This course does not require extensive knowledge of CSS. It does assume that you have a basic understanding of the CSS box model, CSS specificity, CSS selectors, and CSS sizing units. Though you can apply the principles in this course to any modern web framework, including no framework development, this course will be using React and assume you have a basic understanding of React, JSX, and React hooks.
Composing Layout in React is for both novice and experienced developers who want to take their layout skills to the next level. This course will teach you the practical skills you need to build modern layouts for the web without depending on heavy CSS frameworks. Unlike courses and blog posts that teach each layout property in isolation, our product teaches practical layout patterns that you can use every day when solving your layout challenges.
Our students work at
Sample Course Lessons
Course Syllabus and Content
Introduction
1 Lesson 2 Minutes
Introduction to Composing Layouts in React
Composable Layouts
6 Lessons 37 Minutes
Using CSS in this age of components is difficult, especially where web layout is concerned. In this module, you will learn the rules to be able to build composable layouts.
Complex layouts can be broken down into smaller layout primitives that can be combined to build more complex structures. Thinking compositionally will open up a more practical and reusable way of creating layouts on the web.
Knowing where to place your styles is critical to understanding composable layouts. Using the Principles of Encapsulated CSS you will know exactly how to apply your layout styles in your components.
In the lesson, you will learn about Normal Flow and what patterns you can use to apply the principle of Encapsulated CSS in the context of Normal Flow.
You will learn the basics of CSS Flexbox and CSS Grid, especially which properties conform to the Encapsulated CSS principles and which ones do not.
In this lesson you will learn how to reset the default browser styles so that they follow Encapsulated CSS.
Layout Primitives - The Spacers
7 Lessons1 Hours 38 Minutes
An Introduction to layout spacers
The Stack layout pattern is one of the most simple and common layout patterns on the web. In this lesson, you will learn how to build the Stack primitive and how to make it configurable for your situation
The layout challenge that is as old as the web itself is putting two items next to each other. In this lesson, you will learn how to build the Split primitive to solve this problem.
Having a column-based grid system to lay our elements out on is very useful, which is why Bootstrap and other CSS frameworks are built on that model. In this lesson, you will learn how to build the Columns primitive and its helper the Column to build your custom column layout.
Building an inherently responsive grid of items has been reduced down into a single line of CSS. In this lesson, you will learn how to build the Grid primitive that easily lets us achieve this layout.
Text in a paragraph is one of the best examples of "responsive by default." Text will wrap and cluster according to the text alignment. In this lesson, we will learn how to achieve that same effect using the InlineCluster primitive.
Clustering is one way to do responsive inline layouts, but sometimes we want to switch the direction that the items are flowing when we cross a certain threshold. In this lesson, we will learn how to build the Inline primitive that does just that.
Layout Primitives - The Wrappers
6 Lessons1 Hours 16 Minutes
Introduction to layout wrapper primitives
In this lesson, you will learn how to build the PadBox primitive and use it in a Pricing Plan component.
In this lesson, we will be creating a Center layout primitive that centers itself and its children.
In this lesson, we will build the Frame primitive, which frames out a visual media, like an image or video, and forces it into the aspect ratio needed for the design without distorting the image.
In this lesson, we will learn how to build the Cover primitive, which will vertically center its children and allow you to inject a top or a bottom section around it.
Let's revisit the Hero section from Module 1 and build it for real using the primitives we have learned.
Composing Layouts in Practice
5 Lessons1 Hours 16 Minutes
Introduction to settings pages
This lesson is going to focus on getting the menu and header completed on our mock Settings Page
This lesson will focus on getting the main section with the sidebar navigation for our Settings page.
In this lesson, we will be focusing on the profile pane.
In this lesson, we will be finishing the Settings page by completing the privacy pane.
Bonus Lessons
3 Lessons
Bonus lessons
In this lesson, you will learn how to build the ColumnDrop primitive and use it to layout BlogPost cards.
In this lesson, you will learn how to build the ColumnDrop primitive and use it to layout BlogPost cards.
Subscribe for a Free Lesson
By subscribing to the newline newsletter, you will also receive weekly, hands-on tutorials and updates on upcoming courses in your inbox.
What Students are Saying
Meet the Course Instructor
Purchase the course today
newline Pro Subscription
$18/MO
Get unlimited access to the course, plus 60+ newline books, guides and courses. Learn More
Billed annually or $40/mo billed monthly. Free to cancel anytime.
- Discord Community Access
- Full Transcripts
- Project Completion Guarantee
- Lifetime Access
Plus:
- Unlimited access to 60+ newline Books, Guides and Courses
- Interactive, Live Project Demos for Every newline Book, Guide and Course
- Complete Project Source Code for Every newline Book, Guide and Course
- Best Value š
Frequently Asked Questions
Who is this course for?
Composing Layout in React is for both novice and experienced developers who want to take their layout skills to the next level
What if I need help?
You can ask us questions anytime through the community Discord channel, #composing-layouts-in-react, or by sending us a message.