Skip to main content
Mohammad Shehadeh — home (MSH monogram, letter M filled with the Palestinian flag)

Atomic Design Principles

Published on
3 min read

Atomic Design is a methodology for creating design systems, introduced by Brad Frost. It lets you build interface design systems deliberately and in a clear hierarchy. It has five levels: atoms, molecules, organisms, templates, and pages.

PAGES
TEMPLATES
ORGANISMS
MOLECULES
ATOMS
Button
Input
Label
Icon
Search Form
Input
Button
Label
Header Organism
Logo
Navigation
SearchForm
Blog Post Template
Header
Content
Footer

The Five Levels of Atomic Design

Atoms

Atoms are the basic building blocks of matter. In UI design, atoms are the smallest components, such as:

  • Buttons
  • Input fields
  • Labels
  • Icons
  • Typography styles

Here's an example of an atom component:

1// components/atoms/Button.tsx
2import type { ComponentProps } from 'react';
3
4interface ButtonProps extends ComponentProps<'button'> {
5  variant?: 'primary' | 'secondary';
6}
7
8export const Button = ({ children, variant = 'primary', ...props }: ButtonProps) => {
9  return (
10      <button
11          className={`px-4 py-2 rounded ${
12              variant === 'primary' ? 'bg-blue-500 text-white' : 'bg-gray-200'
13          `}
14          {...props}
15      >
16          {children}
17      </button>
18  );
19};

Molecules

Molecules are groups of atoms bonded together that take on distinct new properties.

  • Search forms (input + button)
  • Navigation items (text + icon)
  • Form fields (label + input + error message)

Here's an example of a molecule:

1// components/molecules/SearchForm.tsx
2import { Button } from '@/components/atoms/Button';
3import { Input } from '@/components/atoms/Input';
4
5export const SearchForm = () => {
6  return (
7      <form className="flex gap-2">
8          <Input type="text" placeholder="Search..." className="rounded border px-3 py-2" />
9          <Button>Search</Button>
10      </form>
11  );
12};

Organisms

Organisms are groups of molecules joined together to form a relatively complex, distinct section of an interface.

  • Navigation bars
  • Footer sections
  • Sidebar widgets
  • Product cards

Here's an example of an organism:

1// components/organisms/Header.tsx
2import { Logo } from '@/components/atoms/Logo';
3import { NavItem } from '@/components/molecules/NavItem';
4import { SearchForm } from '@/components/molecules/SearchForm';
5
6export const Header = () => {
7  return (
8      <header className="flex items-center justify-between p-4 border-b">
9          <Logo />
10          <nav className="flex gap-4">
11              <NavItem icon="home" text="Home" />
12              <NavItem icon="about" text="About" />
13              <NavItem icon="contact" text="Contact" />
14          </nav>
15          <SearchForm />
16      </header>
17  );
18};

Templates

Templates are page-level objects that place components into a layout and define the design's content structure. They focus on structure, not the final content.

Here's an example of a template:

1// components/templates/BlogPostTemplate.tsx
2import { Header } from '@/components/organisms/Header';
3import { Footer } from '@/components/organisms/Footer';
4import { Sidebar } from '@/components/organisms/Sidebar';
5
6export const BlogPostTemplate = () => {
7  return (
8      <div className="max-w-4xl mx-auto">
9          <Header />
10          <main className="grid grid-cols-12 gap-8">
11              <article className="col-span-8">
12                  {/* Article content goes here */}
13              </article>
14              <aside className="col-span-4">
15                  <Sidebar />
16              </aside>
17          </main>
18          <Footer />
19      </div>
20  );
21};

Pages

Pages are specific instances of templates with the final, real content. They have the highest fidelity and let you test how well the design system works.

Benefits of Atomic Design

  1. Reusability: Components can be reused across different parts of the application
  2. Consistency: Ensures consistent design patterns throughout the application
  3. Maintainability: Easier to maintain and update components
  4. Scalability: New components can be created by combining existing ones
  5. Collaboration: Provides a common language for designers and developers

Best Practices

  1. Start with the smallest components (atoms) and work your way up
  2. Keep components focused and single-responsibility
  3. Document your components and their variations
  4. Use a consistent naming convention
  5. Consider accessibility in your atomic components
  6. Test components in isolation and in context

Conclusion

Atomic Design gives you a systematic way to build scalable, maintainable design systems. By breaking interfaces into their basic components and building them up step by step, you create more consistent, efficient, and maintainable user interfaces.

Atomic Design is not just about creating components. It's about creating a system that helps teams work together and build better user experiences.

Related Articles

GET IN TOUCH

Let's work together

I build fast, accessible, and delightful digital experiences for the web. Whether you have a project in mind or just want to connect, I'd love to hear from you.

Get in touch

or reach out directly at hello@mohammadshehadeh.com