LogoLogo
  • What is UDML?
  • Document structure
    • <components>
    • <imports>
    • <instructions>
    • <meta>
    • <styles>
    • <tokens>
    • <mappings>
    • <screens>
  • Directives
    • ai-hint
    • <data> Directive Specification
    • <interaction> Directive
    • <layer> Directive
    • <repeat> Directive
    • <responsive>
    • selection
    • <tracking> Directive
  • Components
    • Layout
      • <accordion> Component
      • <box> Component
      • <column> Component
      • <divider>
      • <grid> Component
      • <row> Component
    • Navigation
      • <breadcrumbs> Component
      • <pagination> Component
      • <tab> Component
      • <tabs> Component
    • Text & Display
      • <avatar>
      • <heading>
      • <icon>
      • <image>
      • <label>
      • <text>
      • <video>
    • Controls & Input
      • <button>
      • <checkbox>
      • <input> Component
      • <radio>
      • <select>
      • <slider>
      • <stepper>
      • <switch>
      • <textarea>
    • Forms
      • <form> Component
      • <formField> Component
      • <formGroup> Component
    • Data Collections
      • <dataColumn> Component
      • <dataTable> Component
      • <list> Component
      • <timeline> Component
      • <treeView> Component
    • Data Visualization
      • <chart> Component
      • <summary> Component
    • Modals
      • <dialog> Component
      • <modal> Component
      • <popover> Component
      • <toast> Component
      • <tooltip> Component
  • Prompting Guides
    • Prompting AI Developer Tools with UDML
    • Working with UDML in an Existing Codebase
  • Contributing to UDML
Powered by GitBook
On this page
  • 🧠 Purpose
  • 🛠 Syntax
  • 🔑 Supported Token Types
  • 🧩 AI Interpretation Guidelines
  • ✅ Example
Edit on GitHub
  1. Document structure

<tokens>

The <tokens> section defines global design variables that can be reused across all components and screens. This includes things like colors, spacing, typography, border radii, and elevations.


🧠 Purpose

Tokens create consistency and portability across the design system. They act as design variables that AI agents can resolve into concrete values in the final output.


🛠 Syntax

<tokens>
  <color name="primary" value="#3366FF"/>
  <spacing name="md" value="16px"/>
  <font name="heading" value="Inter" weight="600" size="24px"/>
</tokens>
  • Each token type has a required name and one or more value attributes.

  • Names are used to reference tokens in components (e.g., color="primary").


🔑 Supported Token Types

Tag
Attributes
Example Use

<color>

name, value

Button background

<spacing>

name, value

Gap in layouts

<font>

name, value, weight, size

Typography

<radius>

name, value

Border radius

<elevation>

name, value

Shadow depth


🧩 AI Interpretation Guidelines

  • AI agents should resolve token references (e.g., color="primary") into concrete values during code generation.

  • Tokens map directly to style systems in CSS, Tailwind, or component libraries.


✅ Example

<tokens>
  <color name="accent" value="#00B894"/>
  <spacing name="xl" value="32px"/>
  <radius name="rounded" value="12px"/>
</tokens>
Previous<styles>Next<mappings>

Last updated 2 months ago