Web UI Standards
This section explains how Decentraland builds web UI for dApps using our component library and design system. These standards ensure consistency, accessibility, and maintainability across all web applications.
Overview
Our web UI architecture is built on three core pillars:
UI2 (
decentraland-ui2) - Our primary component library and design systemMaterial UI (MUI) - The foundation wrapped by UI2 with Decentraland theming
Design System - Unified colors, typography, spacing, and components
UI2: The Single Source of Truth
UI2 is our current component library that wraps Material UI components with Decentraland's theme and provides custom components like Navbar that don't exist in MUI.
Live Demo: ui2.decentraland.org
GitHub: github.com/decentraland/ui2
Figma Library: Decentraland UI2 on Figma
UI1: Legacy Library
UI1 (decentraland-ui) is our previous component library, still maintained but being gradually migrated to UI2. See the Migration Guide for details on transitioning components.
Documentation Sections
Process Overview - UX discovery, Figma design, and implementation workflow
Custom Components - Guidelines for project-specific and reusable components
Styling & Theming - Comprehensive styling standards using styled-components
Migration Guide - Migrating components from UI1 to UI2
Key Principles
1. Design-Implementation Alignment
What's designed in Figma is what gets built in code. Our process ensures:
UX defines goals, flows, and states
Designers work from our Figma library (mirrors MUI + Decentraland theme)
Developers implement using UI2 components
2. Theme-First Approach
All visual properties MUST come from the UI2 theme:
Colors:
theme.paletteanddclColorsTypography: Material Design type scale
Spacing:
theme.spacing(n)Breakpoints: Predefined responsive breakpoints
No arbitrary values: No ad-hoc hex codes or pixel values
3. Accessibility by Default
Every component MUST:
Support keyboard navigation
Provide visible focus states
Include ARIA labels where appropriate
Meet color contrast requirements
Handle all states (loading, error, disabled)
4. Strong Typing
Use TypeScript throughout:
Typed theme with autocomplete
Typed component props
Typed styled-components
No
anytypes
Component Hierarchy
Quick Start Example
Theme Reference
Colors
Source: colors.ts
Typography
Source: typography.ts
Breakpoints
Source: index.ts
Standards Compliance
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this documentation are to be interpreted as described in RFC 2119.
Getting Started
Review the Process Overview to understand the workflow
Learn about Custom Components for when to create new components
Study Styling & Theming for implementation details
If migrating from UI1, see the Migration Guide
Resources
Storybook: ui2.decentraland.org
Figma Library: DCL UI2 Design System
Material UI Docs: mui.com
Material Design: material.io
GitHub Repository: decentraland/ui2
Last updated