Design System Essentials

Introduction to Design Systems

A design system is an essential toolkit for creating cohesive and efficient user interfaces. It encompasses a collection of reusable components, principles, constraints, and best practices. The goal is not to limit creativity but to streamline design and development processes. A design system typically includes a component library, which provides developers with reusable parts for constructing interfaces.

In addition to components, a design system offers guidelines on using color, typography, and iconography. It acts as a comprehensive resource for designers, developers, and testers, ensuring consistency and efficiency across platforms. By establishing clear protocols, a design system simplifies the creation of user-friendly applications.

The Evolution of Our Design System

Our journey began with the realization that we were repeatedly creating the same components and addressing similar design questions. This prompted research into design systems and led to the development of our initial prototype. Over the years, we have iterated and expanded our design system significantly.

Starting from basic guidelines on color and typography, we have grown to support over 70 components and collaborate with more than 50 developers. Our system now spans multiple platforms, including web and mobile through React and React Native.

Understanding User Needs

Recognizing the diverse user base of our design system was crucial. We identified three primary user types: designers, developers, and testers. This understanding allowed us to create tailored documentation for each group.

For designers, we offer tools and resources to facilitate quick and efficient design creation. Developers receive guidance on setting up environments and using components effectively. Testers are provided with detailed instructions on testing applications built with our design system.

Project Architecture and Monorepo

Initially, our design system focused solely on web components. However, as the system evolved, we faced the challenge of incorporating mobile, desktop, and utility components. A significant decision was to transition our codebase to a monorepo, allowing seamless integration of various elements.

Starting with a monorepo from the outset is advisable, as migrating later can be complex. A monorepo offers the flexibility to grow alongside the design system's needs, facilitating code sharing and reducing redundancy.

Ensuring Code Quality and Consistency

Maintaining code quality and consistency is vital in a design system. We achieved over 80% code coverage through extensive unit testing. However, to further prevent bugs, we expanded our scope to include example applications within the monorepo.

These example apps demonstrate component usage and help identify regressions or defects. Automation testing tools like Cypress are integrated into our CI/CD pipeline, automatically checking for issues and preventing flawed builds from proceeding.

Streamlining Component Management

As a design system grows, managing files can become overwhelming. We opted to co-locate code, tests, documentation, and styles within component directories. This approach simplifies navigation and improves collaboration.

For instance, each component directory includes end-to-end tests, unit tests, documentation, styles, and the component file. Markdown is used for documentation, making it accessible to non-technical team members.

Establishing a Unified Code Style

Uniform code style across a design system is crucial for maintainability. We enforce a singular code style using a linter, which runs as a pre-commit hook and as part of the CI/CD pipeline.

This ensures that code adheres to established styles, reducing discrepancies and enhancing the learning curve for new developers joining the project.

Comprehensive Documentation

Documentation is a cornerstone of any design system. We evaluated several frameworks and chose Next.js for its flexibility in creating a custom documentation site. Our documentation pages, built with Markdown, offer detailed insights into each component.

For example, a Button component page includes component details, a mobile counterpart toggle, interactive previews, usage examples, and a dynamically generated props table. Libraries like react.gen typescript automate prop parsing, ensuring documentation accuracy and ease of maintenance.

Conclusion

Scaling and maintaining a design system involves understanding user needs, establishing a robust project architecture, ensuring code quality, streamlining component management, enforcing a unified code style, and creating comprehensive documentation. These elements collectively enhance the usability and efficiency of the design system, benefiting developers, designers, and testers alike.

Watch full talk with demos and examples:

Watch video on a separate page
Rate this content
Bookmark

This talk has been presented at React Summit US 2024, check out the latest edition of this React Conference.

FAQ

S&C Electric Company chose React for their design system due to its strong community support, excellent performance for large applications, and multi-platform support through tools like React Native.

Co-locating code improves maintainability by organizing all relevant files (tests, styles, docs) for a component in a single directory, simplifying the onboarding process and daily work for developers.

Patterns document common interface elements like login forms and navigation layouts, providing examples and code to prevent reinventing the wheel and ensuring consistency across applications.

The key components include over 70 components supported on four platforms, documentation for designers, developers, and testers, and a monorepo setup for seamless integration of web and mobile components.

A design system is a collection of reusable components, principles, constraints, and best practices governed by clear standards. It includes a component library, guidelines for color, iconography, typography, support docs, and patterns for constructing interfaces.

They use unit tests to achieve over 80% code coverage, implement a monorepo for easier management, and utilize automation testing tools like Cypress in their CI/CD pipeline to prevent bugs and ensure code quality.

They evaluated tools like Docusaurus, Box, Styleguides, and Next.js, ultimately choosing Next.js to build a comprehensive and custom design system documentation site.

They developed a custom script to parse JSX files and collect data on component usage across projects, which is then reported to a dashboard for better decision-making and communication with stakeholders.

They communicate releases through messages on Teams or Slack, emails, and scheduled demos, highlighting new features and changes to stakeholders effectively.

Ameer Sami
Ameer Sami
18 min
22 Nov, 2024

Comments

Sign in or register to post your comment.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Design Systems: Walking the Line Between Flexibility and Consistency
React Advanced 2021React Advanced 2021
47 min
Design Systems: Walking the Line Between Flexibility and Consistency
Top Content
The Talk discusses the balance between flexibility and consistency in design systems. It explores the API design of the ActionList component and the customization options it offers. The use of component-based APIs and composability is emphasized for flexibility and customization. The Talk also touches on the ActionMenu component and the concept of building for people. The Q&A session covers topics such as component inclusion in design systems, API complexity, and the decision between creating a custom design system or using a component library.
Build a Design System with React and Tailwind CSS
React Summit 2022React Summit 2022
27 min
Build a Design System with React and Tailwind CSS
Top Content
This Talk discusses design systems and how to build one using React and Tailwind CSS. Tailwind CSS provides utility classes for building complex layouts without writing CSS rules. Custom colors can be added to the Tailwind CSS config file, and font styles and text sizes can be customized. The entire Tailwind CSS configuration can be customized to meet specific requirements. Base styles can be added to the config file itself using a plugin. Reusable components can be created with Tailwind CSS, allowing for easy customization of size and color.
Walking the Line Between Flexibility and Consistency in Component Libraries
React Summit 2022React Summit 2022
27 min
Walking the Line Between Flexibility and Consistency in Component Libraries
This Talk discusses the comparison between Polaris and Material UI component libraries in terms of consistency and flexibility. It highlights the use of the action list pattern and the customization options available for the action list component. The Talk also emphasizes the introduction of a composite component to improve API flexibility. Additionally, it mentions the importance of finding the right balance between flexibility and consistency and the use of types to enforce specific child components.
Find Out If Your Design System Is Better Than Nothing
React Summit 2022React Summit 2022
20 min
Find Out If Your Design System Is Better Than Nothing
Building a design system without adoption is a waste of time. Grafana UI's adoption is growing consistently over time. The factors affecting design system adoption include the source mix changing, displacement of Homebrew components by Grafana UI, and the limitations of Grafana UI's current state. Measuring adoption is important to determine the success of a design system. The analysis of code through static code analysis tools is valuable in detecting and tracking component usage.
Dialog Dilemmas and Modal Mischief: A Deep Dive Into Pop-Ups
JSNation 2023JSNation 2023
10 min
Dialog Dilemmas and Modal Mischief: A Deep Dive Into Pop-Ups
The Talk discusses the use of dialogues and popovers in web development. Dialogues can be modal or non-modal and are now accessibility-supported. Popovers are versatile and can be added to any element without JavaScript. They provide suggestions, pickers, teaching UI, list boxes, and action menus. Modal and non-modal dialogues and popovers have different behaviors and dismissal methods. Browser support for these features is expanding, but there are still open questions about positioning, semantics, and other use cases.
Type-safe Styling for React Component Packages: Vanilla Extract CSS
React Advanced 2023React Advanced 2023
19 min
Type-safe Styling for React Component Packages: Vanilla Extract CSS
Watch video: Type-safe Styling for React Component Packages: Vanilla Extract CSS
Today's Talk introduces Vanilla Extract CSS, a type-safe styling method for React applications. It combines the benefits of scoped styling, zero runtime overhead, and a great developer experience. Vanilla Extract generates a static CSS file at build time, resulting in better performance. It is framework agnostic and offers a powerful toolkit, including Sprinkles for utility classes and CSS utils for calculations. With type safety and the ability to define themes and variants, Vanilla Extract makes it easy to create efficient, scalable, and maintainable design system component packages.

Workshops on related topic

Rapid UI Development in React: Harnessing Custom Component Libraries & Design Systems
React Advanced 2022React Advanced 2022
118 min
Rapid UI Development in React: Harnessing Custom Component Libraries & Design Systems
Workshop
Richard Moss
Richard Moss
In this workshop, we'll take a tour through the most effective approaches to building out scalable UI components that enhance developer productivity and happiness :-) This will involve a mix of hands-on exercises and presentations, covering the more advanced aspects of the popular styled-components library, including theming and implementing styled-system utilities via style props for rapid UI development, and culminating in how you can build up your own scalable custom component library.
We will focus on both the ideal scenario---where you work on a greenfield project---along with tactics to incrementally adopt a design system and modern approaches to styling in an existing legacy codebase with some tech debt (often the case!). By the end of the workshop, you should feel that you have an understanding of the tradeoffs between different approaches and feel confident to start implementing the options available to move towards using a design system based component library in the codebase you work on.
Prerequisites: - Familiarity with and experience working on large react codebases- A good understanding of common approaches to styling in React