What is UXDL?
UXDL is a machine-readable behavioral contract for user-facing products. It gives Product, Design, Engineering, QA, and coding agents stable references for the same screens, states, actions, and relations.
Overview
UXDL (User Experience Description Language) formalizes expected user interface behavior into unambiguous, addressable declarations. It provides a shared target so product managers, designers, software engineers, and automated coding agents agree on exact product behavior before implementation starts.
The Interpretation Step
UXDL is specifically designed for the interpretation step between describing what a product should do (PRD, intent, user research) and deciding how to build it (technical architecture, DB schemas, component trees).
Four Core Primitives
Every user interaction flow in UXDL is constructed using four simple primitives with stable snake_case identifiers:
- Screen — A surface or modal a user interacts with (e.g. checkout). Address: checkout
- State — A meaningful condition of a screen (e.g. payment_failed). Address: checkout.states.payment_failed
- Action — An interactive trigger on a screen (e.g. retry_payment). Address: checkout.actions.retry_payment
- Relation — The destination outcome following an action (e.g. to: billing). Address: checkout.actions.retry_payment.relations.success
Real-World Specification Preview
Here is a complete, minimal UXDL 0.1 document specifying an authentication and billing flow:
uxdl: "0.1"app: Enterprise SaaS Platformtitle: Authentication & Subscription Managementscreens: sign_in: name: Sign In Surface type: page states: default: Ready for credentials input invalid_credentials: Email or password incorrect actions: submit: name: Submit Credentials relations: success: to: billing failed: to: sign_in state: invalid_credentials billing: name: Billing Overview type: page states: active: Plan up to date past_due: Payment past due actions: retry_payment: name: Retry Failed Payment relations: success: to: billing state: activeWhat UXDL Does Not Do
UXDL does not try to replace every product artifact. Keep research, strategy, detailed visual design, technical architecture, and project planning where they make the most sense. UXDL focuses strictly on making observable product behavior addressable and reviewable.