Coinbase Design System (CDS) Documentation
repository·master·Indexed 19 days ago
https://github.com/coinbase/cdsA 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.
What's inside Coinbase Design System (CDS)
- The CDS MCP Server provides Model Context Protocol (MCP) capabilities for the Coinbase Design System (CDS), supporting both web and mobile contexts. It allows AI agents and tools to interact with CDS documentation and components via the MCP standard.
Overview of eslint-plugin-internal
masterTheeslint-plugin-internalis 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.Overview of CDS - Common
masterThe@coinbase/cds-commonpackage 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.Overview of the Color Pairing Tool
masterThe 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.Overview of Coinbase Design System (CDS)
masterCoinbase 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
ThemeProviderto 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.
Overview of @coinbase/mobile-visreg
masterThe
@coinbase/mobile-visregpackage 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:
- Execution:
browserstack-run.mjsuploads the app binary and Maestro flows to BrowserStack, triggers a build on a real device, and downloads screenshots tomaestro-test-output/screenshots/. - Navigation: Each flow uses an inline search to find a component's route, navigates to it, captures a screenshot, and returns to the list.
- Comparison:
upload.mjspushes screenshots to Percy to perform visual diffing against a baseline.
- Execution:
Overview of @coinbase/cds-mobile-visualization
masterThe@coinbase/cds-mobile-visualizationpackage contains a specific domain set of components identified as mobile visualization components. These components were migrated fromcds-webas part of an ongoing effort to decompose the core design system packages (cds-webandcds-mobile) into smaller, more reliable, and specialized packages.What is included in CDS templates
masterAll CDS templates come pre-configured with the following:
- Latest CDS packages: Includes
@coinbase/cds-web,@coinbase/cds-icons, and others. - TypeScript configuration: Ready-to-use TS settings.
- Example components: Demonstrations of common UI patterns.
- Theme setup: Pre-configured with the CDS default theme.
- Responsive layouts: Built using CDS layout components.
- Latest CDS packages: Includes
Overview of @coinbase/cds-web-visualization
masterThe@coinbase/cds-web-visualizationpackage is a specialized domain set of components specifically designed for web visualization. These components were extracted from the corecds-webpackage 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.What is included in the CDS Expo template
masterThe 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.
- CDS Packages: Latest versions of
Use the SparklineGradient component
masterThe
SparklineGradientcomponent is used to render sparkline charts with a gradient effect.Note: This component is currently marked as Deprecated.
It is available for both Web and Mobile platforms. For implementation details, refer to the specific Web or Mobile props tables and examples provided in the documentation.
Use the Switch component
masterThe
Switchcomponent 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).