# Implementation of Atomic design [Atomic design](http://bradfrost.com/blog/post/atomic-web-design/) is a way of organizing web development by break design into components. It is an ideal solution for large service provider with multiple online services. Below is one of the ways to implement atomic design (with traditional web project structure). ## What is core concept of atomic design The core concept of atomic design is making design and code base consistent and reusable by sorting component based on its category. Following the idea, the code base will become a categorized reusable library that could support related projects / products ## Implementation in detail The implementation of atomic design is a process of sorting component with categories and a creation of independent components ### Component category sorting Figuring out the category of each component is the first and the essential part of achieving atomic design code base. In traditional web project, incorrect implementation of categorization may lead to massive refactor process or complex modification across multiple components in the development cycle. That is why developers and designers shall work closely and carefully figure out the category of component before the implementation. There are three main categories in atomic design: Atoms, Molecules and Organisms. To sort out component with atomic design, we shall analyze the component in two main areas: structure, scope #### Structure Component could be identified by its complexity (HTML structure). Here is a quick checklist to identify simple components: - Atoms: one element (HTML tag), no internal functions, always been consumed by another components - Molecules: combine multiple elements (HTML tags), but NOT consuming the full width (edge to edge) of device, and always been consumed by another components, may have internal functions (Javascript), may have style alteration. - Organisms: similar to molecule, but it always consumes the full width of the device, could be a used at root level (direct child of the page) For simple component, this checklist should cover everything. For other complex components, we will need to consider the scope of the component. #### Scope Scope means the control area of the component, and components shall work like lego. For instance, the root `padding` of components is in the scope, but the root `margin` set shall be controlled by its parent component (if it is necessary). Following this scope set, any component shall be able to 'stack' on top of others regardlessly (like lego). This is important because component may include (stack on) other components. The list below demonstrates how component including works in atomic design - Organisms can include other `organisms` `molecules` `atoms` - Molecules can include other `molecules` `atoms` - Atoms can NOT include any elements Incorrect scope implementation is a common and critical mistake in component categorization. It makes component harder or impossible to reusable for our future development. A typical sample of wrong scope usage would be: when an organism includes a molecule, it has to directly modify the element inside of molecule. See sample below. **Incorrect scope sample** ```html
text, just text
text, just text
text, just text