AI Assist
Everything an AI agent needs to use the Urban Design System. Point your AI coding tool at this page or download the Cursor rule file.
What is UDS?
UDS (Urban Design System) is a token-first design system with framework-agnostic Web Components. It works with any stack — HTML, React, Vue, Angular, Svelte — with React wrappers available for React apps.
For AI Agents
If you're an AI coding assistant, here's what you need:
- Machine-readable context: Fetch ai-context.json for the complete token list, component catalog, and framework rules in structured JSON.
- Cursor rule: Download
uds-design-system.mdcand place it in.cursor/rules/— it contains everything inline. - Install UDS: import the UDS CSS bundle, register
@uds/web-components, and use@uds/reactwrappers in React apps. - Icons: Material Symbols Outlined from Google Fonts CDN.
Full Example — Tenant Dashboard
Here's the target component API using the parallel Web Components package:
import './uds/uds.css';
import { registerUdsComponents } from '@uds/web-components';
registerUdsComponents();
<udc-notification tone="info" dismissible>
3 invoices are pending review.
</udc-notification>
<udc-tabs selected-panel="profile">
<udc-tab panel="profile">Profile</udc-tab>
<udc-tab panel="settings">Settings</udc-tab>
<udc-tab-panel panel="profile">
<udc-text-input label="Full name" helper-text="First and last name required"></udc-text-input>
<udc-checkbox name="verified">Verified tenant</udc-checkbox>
<udc-chip variant="filter" selected>Active</udc-chip>
<udc-badge tone="success">In good standing</udc-badge>
<udc-button variant="primary">Save</udc-button>
</udc-tab-panel>
<udc-tab-panel panel="settings">
<udc-tile label="Notifications" description="Send updates by email" selectable></udc-tile>
</udc-tab-panel>
</udc-tabs>Token Architecture — Primitives vs Semantics
UDS has TWO layers of tokens. Primitive tokens (--uds-primitive-*) are raw palette values that NEVER change across themes. Semantic tokens (--uds-color-*, --uds-space-*, etc.) reference primitives and CHANGE when themes switch.
Flow: Figma variable → Primitive CSS token → Semantic CSS token → Your code
RULE: If a variable name contains "primitive", NEVER use it in component code. Only use semantic tokens.
When to Use Which Token
| Token | When to use |
|---|---|
--uds-color-surface-page-main | Full page background |
--uds-color-surface-main | Card / content area backgrounds |
--uds-color-surface-subtle | Headers, table headers, secondary areas |
--uds-color-surface-alt | Zebra stripes, alternate rows, code blocks |
--uds-color-surface-interactive-default | Primary button fill, active accent |
--uds-color-text-primary | Main body text, headings |
--uds-color-text-secondary | Helper text, labels, captions, timestamps |
--uds-color-text-inverse | Text on dark/filled backgrounds |
--uds-color-text-interactive | Links, active tab labels, selected items |
--uds-color-border-primary | Default borders (input fields, cards) |
--uds-color-border-secondary | Subtle dividers, table cell borders |
--uds-color-border-outline-focus-visible | Focus rings (keyboard navigation) |
How Theming Works
Theming works by setting data attributes on <html>. When these change, semantic token VALUES change automatically — your component code stays the same.
/* Same token, different values per theme */
--uds-color-surface-main: #fafafa /* light mode (default) */
--uds-color-surface-main: #1a1a1a /* data-color-scheme="dark" */
--uds-color-text-interactive: #005ff0 /* base brand (default) */
--uds-color-text-interactive: #0066cc /* data-theme="resman" */
/* Your code: always use the semantic token */
background: var(--uds-color-surface-main); /* works in ALL themes */Why Primitives Break Theming
--uds-primitive-color-blue-60-M is ALWAYS #005ff0 regardless of theme.--uds-color-text-interactive changes per brand/mode.
If you use the primitive, your UI breaks when themes switch.
Available Modes
| Attribute | Values | Default | Description |
|---|---|---|---|
data-color-scheme | dark | light | Dark mode — all surfaces, text, borders invert |
data-theme | resman, anyonehome, inhabit | base | Brand — accent colors (interactive, info, links) change |
data-font | poppins, roboto, lexend | Inter | Font family — all text changes typeface |
data-font-scale | smaller, larger | default | All font sizes scale proportionally |
data-density | comfortable | compact | All spacing tokens increase |
Implementation
/* Dark mode — just set the attribute, everything adapts */
<html data-color-scheme="dark">
/* Brand switching — accent colors change automatically */
<html data-theme="resman">
/* Combine modes freely */
<html data-color-scheme="dark" data-theme="resman" data-font="poppins">DO
color: var(--uds-color-text-primary);
padding: var(--uds-space-200);
font-family: var(--uds-font-family);
border-radius: var(--uds-border-radius-input);
box-shadow: var(--uds-shadow-depth-300);DON'T
color: #171717;
padding: 16px;
font-family: 'Inter', sans-serif;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);For Production Code
- Use the framework-agnostic Web Component tags as the component API once each component has landed.
- Use the React wrappers for React apps; they render the same Web Components.
- Per-component spec is in
uds/components/<component>/spec.jsonon this site — fetch it for acceptance criteria, props, events, slots, accessibility. - The current class-based docs examples stay in place only until the Web Component cutover is complete.
Primitives Ban
/* NEVER use primitive tokens in components */
DON'T: color: var(--uds-primitive-color-blue-60-M);
DO: color: var(--uds-color-text-interactive);
/* Primitives don't change with themes. Semantics do. */Keyboard Patterns
Every interactive UDS Web Component must own its keyboard behavior instead of relying on consumers to wire it manually.
| Component | Keyboard Behavior |
|---|---|
| Dropdown | ArrowUp/Down navigate items, Enter/Space select, Escape close |
| Dialog | Escape close, Tab cycles within (focus trap), auto-focus first element on open |
| Tabs | ArrowLeft/Right between tabs, Home/End for first/last |
| List | ArrowUp/Down navigate, Enter/Space select |
| Tile | Enter/Space toggle selection |
| Data Table sort | Enter/Space on header to cycle sort direction |
Error & Validation Patterns
- Validate on blur (not every keystroke)
- Set
data-state="error"on theudc-text-inputorudc-dropdownwrapper - Replace helper text with the error message
- Clear error on next input event
- For form-level errors, show
udc-notificationwithdata-variant="error"
Common Icons
Material Symbols Outlined — browse at fonts.google.com/icons
| Category | Icons |
|---|---|
| Navigation | space_dashboard, book, contact_phone, home_work, monetization_on, settings, account_circle, notifications |
| Actions | add, edit, delete, close, search, clear, download, more_vert, chevron_right |
| Status | info, check_circle, error_outline, warning_amber |
| Content | apartment, home, mail, phone, calendar_today |