ApiaryActive
Try: pause · settings · learn · wipe
← Community / Reading Room
CA
craft · 9 min read

Creating a Design System from Scratch

Design is often mistaken for the act of making things look "pretty." In reality, design is the orchestration of systems. When a product grows from a single…

Design is often mistaken for the act of making things look "pretty." In reality, design is the orchestration of systems. When a product grows from a single landing page to a complex ecosystem—especially one as multifaceted as Apiary, where we bridge the gap between biological conservation and autonomous AI—the traditional method of "designing page-by-page" becomes a liability. It leads to "design debt," a state where every new feature requires a fresh set of decisions about button radii, hex codes, and spacing scales, resulting in a fragmented user experience and an exhausted engineering team.

A design system is the antidote to this entropy. It is not a static UI kit or a PDF brand guideline; it is a living, breathing product that serves other products. It is a single source of truth that codifies the visual language, the behavioral patterns, and the technical implementation of an interface. By shifting the focus from outputs (screens) to inputs (components and tokens), a design system allows a team to scale their velocity without sacrificing quality. It transforms the design process from a series of repetitive chores into a high-level architectural exercise.

For Apiary, a design system is more than a utility—it is a reflection of our philosophy. Just as a beehive operates through a decentralized yet highly coordinated set of biological rules, our digital interface must function as a cohesive organism. Whether a user is tracking pollinator populations or configuring a self-governing AI agent, the interaction patterns must feel intuitive and unified. This guide serves as the definitive blueprint for building that system from the ground up, moving from the smallest atomic particles to the complex organisms of a full-scale application.

I. The Foundation: Design Tokens and the Atomic Scale

Before a single component is drawn, you must define the "genetic code" of your system: Design Tokens. Design tokens are the smallest possible pieces of a design system—agnostic variables that store visual design attributes. Instead of hard-coding a value like #F2C94C (a honey-gold) across a hundred CSS files, you define a token called color-brand-primary.

Tokens decouple the decision from the implementation. If the brand evolves and that gold needs to shift toward a deeper amber, you update the token in one place, and the change propagates across the entire ecosystem—web, iOS, Android, and AI-generated interfaces.

A robust token system is categorized into three tiers:

  1. Global Tokens (Primitive): These are the raw values. Example: color-yellow-500: #F2C94C. They have no semantic meaning; they are simply a palette.
  2. Alias Tokens (Semantic): These give the raw values meaning. Example: color-action-primary: var(color-yellow-500). This tells the designer and developer how the color is used.
  3. Component-Specific Tokens: These are the most granular. Example: button-primary-background: var(color-action-primary).

Beyond color, tokens must be applied to the rest of the visual scale. A professional system utilizes a 4px or 8px spacing grid. Why? Because 8 is divisible by more integers than 4 or 10, providing greater flexibility across different screen densities. By limiting spacing to multiples of 8 (8px, 16px, 24px, 32px), you eliminate the "pixel-pushing" debates between designers and developers. You no longer ask, "Should this be 15px or 20px?" You simply choose between spacing-2 (16px) and spacing-3 (24px).

Similarly, typography should be tokenized into a modular scale. Rather than picking arbitrary font sizes, use a ratio (such as the Major Third, 1.250) to ensure that the jump from an H3 to an H2 feels mathematically harmonious. This creates a visual hierarchy that guides the user’s eye naturally, reducing cognitive load and increasing the accessibility of complex data.

II. Atomic Design: From Atoms to Organisms

To organize these tokens into a usable library, we employ the atomic-design methodology. Developed by Brad Frost, this mental model treats UI elements as biological entities that grow in complexity.

Atoms are the fundamental building blocks. An atom cannot be broken down further without losing its function. Examples include a single button, an input field, a label, or a specific icon. An atom is defined not just by its looks, but by its states. A button atom is not just a rectangle; it is a collection of states: Default, Hover, Active, Focused, Disabled, and Loading. Failing to define these states at the atomic level is the primary cause of "jank" in user interfaces.

Molecules are groups of atoms bonded together to function as a unit. A search bar is a classic molecule: it consists of a text input atom, a button atom, and perhaps a label atom. Molecules are the first point where behavior enters the system. The molecule defines how the atoms interact—for instance, how the search button triggers the input field's validation.

Organisms are complex UI components composed of groups of molecules and atoms. A global navigation header is an organism. It contains a logo (atom), a search bar (molecule), and a navigation menu (molecule). Organisms are often the primary units of delivery for developers. When a developer is asked to build a page, they aren't thinking in atoms; they are assembling organisms.

By adhering to this hierarchy, you ensure that a change at the atomic level (e.g., changing the border-radius of all buttons) automatically updates every molecule and organism in the system. This is the essence of scalable design.

III. Building the Component Library: The Engineering Bridge

A design system is useless if it exists only in Figma. The "gap" between design and code is where most projects fail. To bridge this, you must build a synchronized Component Library—a living set of coded elements (typically in React, Vue, or Web Components) that mirror the design tokens and atomic structures.

The goal is parity. If the Figma component is named Button/Primary/Large, the coded component should be <Button variant="primary" size="large" />.

When building the library, focus on these three technical pillars:

  1. Prop-Driven Architecture: Components should be highly configurable via properties (props) but strictly constrained. A developer should be able to change the icon of a button via a prop, but they should not be able to change the button's padding manually. This prevents "rogue styling" and maintains brand consistency.
  2. Accessibility (a11y) as a Default: Accessibility cannot be an afterthought; it must be baked into the component. This means ensuring that every input has a linked label, every icon has an aria-label, and the color tokens meet WCAG 2.1 AA contrast ratios (at least 4.5:1 for normal text). In a platform like Apiary, which aims for global conservation impact, inclusivity is a moral and functional imperative.
  3. Documentation as Code: The library must be accompanied by a documentation site (using tools like Storybook or Docusaurus). This site should serve as the manual for the system, detailing not just what a component is, but when and how to use it. For example, "Use the Alert component for system errors; use the Toast component for non-critical confirmations."

By treating the component library as a product, you move the conversation from "Does this look right?" to "Is this the correct component for this use case?"

IV. Design Patterns and Behavioral Logic

While components are the what, patterns are the how. A component library gives you a button; a design pattern tells you how a user completes a task.

Patterns are recurring solutions to common design problems. For instance, a "Filter Pattern" might involve a sidebar of checkboxes that updates a data table in real-time. This isn't a single component, but a choreographed sequence of components working together to achieve a goal.

Key patterns to codify in your system include:

  • Onboarding Flows: How do we introduce a new user to the concept of AI agents? Is it a linear walkthrough, a checklist, or a "learn-by-doing" tool-tip system?
  • Data Visualization: For conservation data, how do we represent population decline or growth? We must standardize the use of line charts for trends and heatmaps for geographic distribution to ensure users can interpret data across different modules without relearning the visual language.
  • Error Handling: How does the system communicate failure? We define a pattern for "Empty States" (when no data is present) and "Error States" (when a request fails), ensuring that the user is always given a clear path forward rather than a dead end.

Establishing patterns is where the "intelligence" of the design system resides. It is similar to the pheromone trails bees use to communicate the location of food; it provides a clear, efficient path for the user to follow, reducing the friction between their intent and the result.

V. Governance: Maintaining the Living System

The most dangerous phase of a design system is the "Post-Launch Slump." This happens when a system is built, launched, and then ignored as the product evolves. Without a governance model, the system quickly becomes obsolete, and developers begin writing custom CSS "just this once," leading back to the design debt we sought to eliminate.

Governance is the process of deciding how the system evolves. You need a clear mechanism for adding new components or updating existing ones. We recommend a Contribution Model based on three roles:

  1. The Core Team (The Librarians): A small group of designers and engineers who maintain the system, review contributions, and ensure architectural integrity.
  2. The Contributors (The Builders): Any designer or engineer who notices a gap in the system. Instead of building a one-off solution, they propose a new component or update to the Core Team.
  3. The Consumers (The Users): Those who use the system to build features. Their role is to provide feedback on the usability and flexibility of the components.

The workflow for a new component should look like this: Proposal $\rightarrow$ Design/Code Review $\rightarrow$ Implementation in Sandbox $\rightarrow$ Documentation $\rightarrow$ Global Release.

This structured approach prevents "component bloat"—the tendency to create five different types of buttons when one flexible button with different props would suffice. Governance ensures the system remains lean, efficient, and capable of evolving alongside the platform.

VI. The Intersection of AI and Systemic Design

As we integrate self-governing AI agents into the Apiary ecosystem, the design system must evolve to handle Dynamic UI. Traditional design systems are deterministic: the designer decides exactly where the button goes. However, an AI agent might need to generate a custom interface on the fly based on the user's specific goal.

To accommodate this, we move toward Intent-Based Design. Instead of designing a static page, we design "Slots" and "Capabilities."

For example, instead of a fixed dashboard, we create a "Data Visualization Slot." The AI agent, understanding the user's intent ("I want to see the correlation between rainfall and bee colony health in the Pacific Northwest"), selects the appropriate components from the library—a date picker, a line chart, and a regional filter—and assembles them in real-time.

This requires the design system to be even more rigorous. If an AI is assembling the UI, there is no human designer to "fix" a layout that looks slightly off. The constraints (the spacing tokens, the grid system, and the component boundaries) must be absolute. The AI becomes the ultimate stress test for the design system; if the system is logically sound, the AI-generated UI will be consistent. If the system is flimsy, the AI will amplify those flaws a thousandfold.

Why It Matters

Building a design system from scratch is a massive upfront investment. It requires hundreds of hours of planning, documenting, and debating the nuances of a border-radius. To the uninitiated, it may seem like over-engineering.

But for a project with the ambition of Apiary, it is the only way forward. We are not just building a website; we are building a tool for planetary stewardship. When our interfaces are consistent, we lower the barrier to entry for scientists, activists, and citizens. When our engineering process is streamlined, we can iterate on AI agents with a speed that matches the urgency of the climate crisis.

A design system is, ultimately, an exercise in empathy. It is empathy for the user, who deserves a frictionless experience, and empathy for the developer, who deserves a clear set of tools. By codifying our visual and behavioral logic, we move away from the chaos of the "page" and toward the elegance of the "system"—creating a digital environment that is as resilient, efficient, and harmonious as the biological systems we strive to protect.

Frequently asked
What is Creating a Design System from Scratch about?
Design is often mistaken for the act of making things look "pretty." In reality, design is the orchestration of systems. When a product grows from a single…
What should you know about i. The Foundation: Design Tokens and the Atomic Scale?
Before a single component is drawn, you must define the "genetic code" of your system: Design Tokens. Design tokens are the smallest possible pieces of a design system—agnostic variables that store visual design attributes. Instead of hard-coding a value like #F2C94C (a honey-gold) across a hundred CSS files, you…
What should you know about iI. Atomic Design: From Atoms to Organisms?
To organize these tokens into a usable library, we employ the atomic-design methodology. Developed by Brad Frost, this mental model treats UI elements as biological entities that grow in complexity.
What should you know about iII. Building the Component Library: The Engineering Bridge?
A design system is useless if it exists only in Figma. The "gap" between design and code is where most projects fail. To bridge this, you must build a synchronized Component Library—a living set of coded elements (typically in React, Vue, or Web Components) that mirror the design tokens and atomic structures.
What should you know about iV. Design Patterns and Behavioral Logic?
While components are the what , patterns are the how . A component library gives you a button; a design pattern tells you how a user completes a task.
References & sources
  1. Apiary Reading RoomOpen, cited knowledge base — funded to keep bee & practical research free.
From the Apiary Reading Room. Opinion & editorial — not financial advice. We don't overclaim.
More from the Reading Room