Coinbase Design System (CDS) Documentation

repository·master·Indexed 19 days ago

https://github.com/coinbase/cds

A comprehensive collection of design assets, components, and documentation for maintaining visual and functional consistency across Coinbase products. Includes web components via Storybook, an Expo-based mobile demo app, and a Docusaurus documentation site featuring a Color Pairing Tool for mapping colors to CDS spectrum primitive tokens with WCAG accessibility validation.

Tokens
606.8K
Snippets
1.8K
Records
2.3K
Agent score
67%

What's inside Coinbase Design System (CDS)

  1. Overview of eslint-plugin-internal

    master
    The eslint-plugin-internal is a custom ESLint plugin designed exclusively for use within the Coinbase Design System (CDS) repository. It is not published as an external package. The plugin provides a suite of specialized rules to enforce CDS-specific best practices, prevent common bugs in the web and mobile packages, and manage deprecations. Because the repository root depends on this library for its linting tasks, it does not have a separate build process to avoid blocking the main build pipeline.
  2. Overview of CDS - Common

    master
    The @coinbase/cds-common package provides shared types and hooks designed to be used across both web and mobile platforms within the Coinbase Design System ecosystem. This ensures consistency in logic and data structures between different runtime environments.
  3. Overview of the Color Pairing Tool

    master
    The Color Pairing Tool is an interactive documentation site utility designed to map arbitrary colors to the closest Coinbase Design System (CDS) spectrum primitive tokens. It supports image uploads or manual color input, verifies WCAG accessibility contrast, and generates both light- and dark-mode token pairings. The tool also provides a playground to preview these pairings on real CDS components like Buttons, Tags, MessagingCards, and LineCharts.
  4. Overview of Coinbase Design System (CDS)

    master

    Coinbase Design System (CDS) is a cross-platform component library designed for both React (Web) and React Native (Mobile). It is built to ensure a consistent user experience across all Coinbase products by providing highly reusable, accessible, and themeable components.

    Core Capabilities

    • Cross-platform: Components are designed to be as identical as possible between React DOM and React Native.
    • Theming: Uses a ThemeProvider to support custom themes and light/dark modes.
    • Styling: Supports StyleProps, classnames, and inline styles. Web components use Atomic static CSS compiled at build time for zero runtime overhead.
    • Composition: Components are built using subcomponents that can be customized or replaced via props.
    • Accessibility: Accessible out of the box with support for various accessibility standards.
  5. Overview of @coinbase/mobile-visreg

    master

    The @coinbase/mobile-visreg package provides visual regression testing for CDS mobile components. It automates the process of running Maestro flows on real iOS and Android devices via BrowserStack App Automate and uploads the resulting screenshots to BrowserStack App Percy for visual comparison across different branches.

    Workflow Summary:

    1. Execution: browserstack-run.mjs uploads the app binary and Maestro flows to BrowserStack, triggers a build on a real device, and downloads screenshots to maestro-test-output/screenshots/.
    2. Navigation: Each flow uses an inline search to find a component's route, navigates to it, captures a screenshot, and returns to the list.
    3. Comparison: upload.mjs pushes screenshots to Percy to perform visual diffing against a baseline.
  6. Overview of @coinbase/cds-mobile-visualization

    master
    The @coinbase/cds-mobile-visualization package contains a specific domain set of components identified as mobile visualization components. These components were migrated from cds-web as part of an ongoing effort to decompose the core design system packages (cds-web and cds-mobile) into smaller, more reliable, and specialized packages.
  7. Overview of @coinbase/cds-web-visualization

    master
    The @coinbase/cds-web-visualization package is a specialized domain set of components specifically designed for web visualization. These components were extracted from the core cds-web package as part of an ongoing effort to decompose the core design system packages into smaller, more reliable, and more maintainable modules. Use this package when you need visualization-specific components without importing the entire core web library.
  8. What is included in the CDS Expo template

    master

    The Expo template is a complete starter kit for cross-platform mobile applications built with React Native. It includes:

    • CDS Packages: Latest versions of @coinbase/cds-mobile, @coinbase/cds-icons, and other core libraries.
    • TypeScript: Pre-configured TypeScript settings.
    • UI Patterns: Example components demonstrating common UI patterns.
    • Theming: Default CDS theme setup.
    • Navigation: Integration with React Navigation.
  9. Use the Switch component

    master

    The Switch component is an input control used to toggle between two states (e.g., on/off). It is available for both Web and Mobile platforms within the Coinbase Design System.

    To use the Switch, you can import it from the respective platform package. Detailed usage examples, props, and styling options are available in the platform-specific documentation sections (Web or Mobile).