Intro to Atomic Design Patterns [with examples]

Atomic design is a mental model of how the UI should be built and laid out. It is at the core of how we are going to build our apps.

Project Source Code

Get the project source code below, and follow along with the lesson material.

Download Project Source Code

To set up the project on your local machine, please follow the directions provided in the README.md file. If you run into any issues with running the project source code, then feel free to reach out to the author in the course's Discord channel.

This lesson preview is part of the The newline Guide to React Native for JavaScript Developers using TypeScript course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.

This video is available to students only
Unlock This Course

Get unlimited access to The newline Guide to React Native for JavaScript Developers using TypeScript, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

Thumbnail for the \newline course The newline Guide to React Native for JavaScript Developers using TypeScript
  • [00:00 - 00:11] In this lesson, we'll look at how to build the screens that we set up in the previous modules. We already have the navigation for the app and we have put in some placeholder screens.

    [00:12 - 00:21] So how do we go about building those screens? Should we just start them individually? Let's say we have a team of five to 10 people working.

    [00:22 - 00:32] So we all provide we provide all of them with one individual screen and they start building with the marks or the design that are provided. That will be a great idea.

    [00:33 - 00:45] Instead, what we're going to do is we're going to follow the admin design pattern for building layouts. It basically philosophy that tells how a UI should be built.

    [00:46 - 01:05] And we're also going to look at building and design system in this module and the two are not dependent on each other. But if you're able to write me break our UI into the admin design pattern and and build a design system according to what our designers have have planned for the app.

    [01:06 - 01:25] The two work together very well to come out and build an app that is not just a beautiful, but consistent, scalable, modular and very, very manageable. Now those are some pretty heavy words and we all want to achieve all of that.

    [01:26 - 01:31] But how do we do it? In practical scenarios, we've seen that down the line, we're trying to deliver a project.

    [01:32 - 01:40] We might have to cut corners and compromise with them and that's where the difference is. I like to use the example of law team in this case a lot.

    [01:41 - 01:52] So we all know the pain that a designer goes through when they're trying to create a particular animation, right? They look at each and every frame how they're supposed to move it in a certain flow.

    [01:53 - 02:10] And and they get done with it and they pass it on to the developers to replicate that in on a website or on a app. Now the developer needs to go through the same cycle and the additional challenge of that is that they also need to take care.

    [02:11 - 02:21] Of the technology that they're using to build those right and the technological limitations. Lottie what it does is abstracts all that out.

    [02:22 - 02:32] It basically takes the designers flow of the entire animation as a JSON and plugs it into the app and developer. They don't need to build the animation at all.

    [02:33 - 02:43] They just just need to plug in the JSON and it will replicate the entire effort that the designers put. Now that is a separation of design and development right?

    [02:44 - 02:58] And that is what following the add we desire pattern along with a design system is going to help us achieve. Once we understand the concept of at-will design pattern and how it helps build layouts and we have drilled our design system.

    [02:59 - 03:16] Following these will not be a conscious decision that our team or developers will need to make while building the app. These will form as a daily of the app and with the bell going forward is automatically going to keep design and development separate.

    [03:17 - 03:22] So how does it work? Let's go ahead and see before we start.

    [03:23 - 03:34] So I do design pattern was developed by Brad Frost and Dave Wilson. It derives its name from atoms the most basic building blocks or anything in the entire universe.

    [03:35 - 03:40] So that's how it goes. Let's say that we have a hydrogen atom and it combines with the oxygen atom.

    [03:41 - 03:54] There are different type patterns and they combine to form molecules and molecule could be water. And then those molecules combined to get to form more complex organisms by human beings or animal birds.

    [03:55 - 04:03] So that's how they visualize building a layout. So from my perspective, they have basically broken it down into five different categories.

    [04:04 - 04:19] And that are atoms molecules, organisms, templates and pages. So atoms will be our most basic elements that constitute the UI like a label and input box or button.

    [04:20 - 04:31] These can be the most native elements provided by a browser by the video tag and the input box and similarly on native platforms. Next would be our molecules.

    [04:32 - 04:43] So multiple atoms come together to form a UI element that's called a molecule. It can be examples can be a search input or a form.

    [04:44 - 04:55] So like we can see here we have a label and input box, you know, but we're coming together to form a sort of a search molecule. Next would be organisms.

    [04:56 - 05:14] Now these are more complex elements as in we can combine atoms and molecules together to form an organisms. Now an organism would deliver a feature on its own as in what we see right now is probably got hit an organism.

    [05:15 - 05:22] And it provides a placeholder for logo. We have a navigation list and also the search format for other examples of organisms.

    [05:23 - 05:46] So we have almost anything that we call a component generally on UI today like a product carousel, a section to show the marketing banners and FII section for products, or the give section. All of these individually will combine a lot of atoms and monotubes to deliver one particular functionality and they would form the organisms.

    [05:47 - 05:58] So what would be a template? Template is basically the underlying structure of any piece.

    [05:59 - 06:17] So like example, for example, what we have there is let's say a home based template and what it does it brings together different objects like molecules and organisms. Most will do form an underlying structure of how the entire feeds going to work without the actual images and text that's going to appear.

    [06:18 - 06:42] So what this does is it allows us to visualize how these different components are going to look and function together in the context of an entire view or a stream or a page. And it allows you to how these parts and up together to create that experience.

    [06:43 - 06:51] So let's look at a more real example and it's again from the same particle and fighting. It's a brilliant one.

    [06:52 - 06:59] So it's basically a breakdown of the Instagram app into these different components. Let's go through that.

    [07:00 - 07:12] So for atoms, what do we have for atoms for atoms? We have the items text elements, the two images, the avatar image and the primary image.

    [07:13 - 07:17] And if you look at it, they can't be broken down further into any work elements . Right.

    [07:18 - 07:31] So they form like atoms and constitute the building the molecules and organ use for the things. So the molecule would be the navigation header and the user information session .

    [07:32 - 07:44] Like we have an avatar icon or the handle name and probably when the person was last seen or posted this particular image. Then we have super image.

    [07:45 - 07:50] We have few actionable buttons. So this again can be like a button or an action molecule or an organism.

    [07:51 - 07:56] Then we have some information and some comments. So these are all the different molecules.

    [07:57 - 08:11] So when we combine these molecules, we get organisms for like we see here. So this particular card that that brings forward the entire functionality of a particular post on Instagram with all the information.

    [08:12 - 08:22] The user information, what do you have posted? What was the interaction level, the number of lights, comments and what would the comments, this fourth thing forms the organs.

    [08:23 - 08:39] Now, if you put all of this together without the actual content, we get the template, the template for the entire piece. And when we plug in the data, what we get is the actual page that the user sees , the user experience of the entire app.

    [08:40 - 08:55] With the icons, the user handle, the actual image, the interaction, everything. So as you would see how at we design pattern really helps us break down our different views across screens into smaller of managing the components.

    [08:56 - 09:05] And they are basically defined as atoms, molecules and not can some. So these come together to form templates and templates are mostly at the page level.

    [09:06 - 09:12] Like we would have a full page template, a product detail template. A card for each template on and checkout template.

    [09:13 - 09:38] And then when we plant in actual detail, what we get are our views of pages. So let's also look at that from what the app that we from the perspective of of breaking this particular UI into those five components.

    [09:39 - 09:44] the app that we're going to build before you go ahead with this particular video. So go ahead and do that and play the video once again and we go through it.

    [09:45 - 09:51] Okay. So let's first look at atoms.

    [09:52 - 10:12] So probably the icons and the buttons and the text box here, not not the icon, but just the text box how it's rounded and in the background color. These can be atoms. These icons can also be atoms and similarly the headings, the styling for that will be part of the design system.

    [10:13 - 10:18] We will look at in the coming modules. All of this can be atoms.

    [10:19 - 10:30] This search box can become a molecule as it also has an icon and clicking the icon will probably have some kind of an action. Either we search over here or we take the two different speed.

    [10:31 - 10:36] And similarly, we have a lot of different molecules. We have the navigation molecule over here.

    [10:37 - 10:49] Then this is this is more complex. So it has icon and this particular this whole thing can be a molecule or that constituents and icon are text and a click action.

    [10:50 - 11:03] And this entire thing can be a category organism. Similarly, we have a Afghanistan over here with an organism of a product car and it's as you can see between the two views.

    [11:04 - 11:11] So this is probably a listing view and a landing phase of sort of a home page. So it's used across the screens.

    [11:12 - 11:26] And if we could just visualize the whole thing without these items and these images, that would be a template. So our template is basically a search box with sort of a scanner camera camera icon.

    [11:27 - 11:31] So we can click anything in search for it. A category widget.

    [11:32 - 11:41] Then we have our best sending items and so forth. So let's start off this particular video.

    [11:42 - 11:53] I talked about building an app that is consistent modular, scalable and manageable world. And going through this process of understanding will concept of that and design pattern.

    [11:54 - 12:05] I think we should now be able to visualize how we achieve that. Atoms should help us achieve consistency will be using labels and paradox types and search boxes.

    [12:06 - 12:07] Text boxes. Sorry.

    [12:08 - 12:16] Across the views. Molecules and organisms will help us bring modularity and again consistency.

    [12:17 - 12:32] In terms of scalability, what we need to do is when we scale this app into different views, we try to use based on what we have. And if we need to build something new, we start from the scenes journey.

    [12:33 - 12:57] We start same journey and basically try to define things as atoms and introduce them into our current set of different atoms, molecules and organisms. And in terms of manageability, whenever we need to change something in the app, let's say the design or the colors or let's say the entire product component.

    [12:58 - 13:10] We go and revisit what we have and change them at a more granular level. So my following this particular process, which I like to call storyboarding.

    [13:11 - 13:18] We have done is we basically can now have a thorough understanding of our entire apps. We only saw what's we need to build.

    [13:19 - 13:35] Now we know the components that we need to build how we would break them down into more management pieces and how these different components come together to build on layouts or views. We also know what needs to be built first.

    [13:36 - 13:48] We'll start with atoms and then once we're done with those, we'll want to building our molecules and then finally to more complex and free featured. Fully full feature developing organisms.

    [13:49 - 14:01] What this process also helps us achieve is that let's say that we have common counter across the views. Let's say that we want to persist the search box and a card icon across different screens.

    [14:02 - 14:13] Through our usage to the different steps of user new. So what we know by this process is that we need to build a search molecules which can be reused across books.

    [14:14 - 14:32] So to summarize, we now have a wide plan in place that should give us a lot of confidence going in through the actual development phase. So we'll look at building on of these in the subsequent models.

    [14:33 - 14:35] Thank you. you