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
  • 🔑 Required Attributes
  • 🧩 AI Interpretation Guidelines
  • 🧩 Modal Screen Support
  • ✅ Usage
  • 🔑 Rules
  • 🧠 AI Guidelines
Edit on GitHub
  1. Document structure

<screens>

The <screens> section defines the top-level visual structure of each screen in the application. Each <screen> block is a single view or route, built from layouts and components.


🧠 Purpose

To encapsulate and separate views in a multi-screen app, allowing AI tools to generate screens as files, components, or pages based on their names and content.


🛠 Syntax

<screens>
  <screen name="Home">
    <layout type="stack">
      <text variant="title">Welcome</text>
      <button>Start</button>
    </layout>
  </screen>
</screens>

🔑 Required Attributes

Tag
Attributes
Description

<screen>

name

Unique screen/view identifier


🧩 AI Interpretation Guidelines

  • Treat each <screen> as a self-contained route or view.

  • Use name to determine output file/component naming.

  • Extract nested layouts and components to structure the rendered page.


🧩 Modal Screen Support

UDML supports defining reusable modals and overlays as special screen types.

✅ Usage

<screens>
  <screen name="home">...</screen>
  <screen name="settings">...</screen>

  <!-- Modal defined as a screen -->
  <screen name="deleteConfirm" type="modal">
    <dialog title="Are you sure?" type="confirm">
      <text>This action cannot be undone.</text>
      <layout type="row" justify="end">
        <button variant="secondary">Cancel</button>
        <button variant="primary">Delete</button>
      </layout>
    </dialog>
  </screen>
</screens>

🔑 Rules

  • type="modal" defines the screen as a modal overlay, not a full view.

  • Modals can be reused across multiple flows by referencing the name.

  • Useful for dialogs, confirmations, alerts, authentication popups, etc.

  • AI agents should not treat these as primary routes unless triggered contextually.

🧠 AI Guidelines

  • Render screen[type="modal"] as an overlay or layer on top of the invoking screen.

  • Trigger visibility using a state variable or interaction.

  • Treat modals as independently scoped UI units (like named components).

Previous<mappings>NextDirectives

Last updated 2 months ago