<data> Directive Specification
The <data>
directive provides a simple way to specify data binding for individual elements within a visual design.
🧠Purpose
To enable designers to specify what data should populate each visual element, while maintaining complete control over the element's appearance and layout. Designers often don't have access to the actual data binding values, or they don't even exist yet, so this method allows them to communicate intent in a way that can be easily updated later.
🛠Usage Syntax
1. Basic Element Data
2. Form Field Data
3. Table Column Data
🔑 Attributes
description
string
Yes
Semantic description of the data
mock
string
No
Mock value or mock data type
type
string
No
Data type (string
, number
, boolean
, date
, image
, status
)
format
string
No
Format pattern (e.g., "MM/DD/YYYY" for dates)
transform
string
No
Transformation expression
required
boolean
No
Whether the field is required
✅ Example Usages
User Profile Card
Status Indicator
🧠AI Interpretation Guidelines
Preserve all visual styling and layout
Apply data binding based on the data specification
Generate appropriate mock data based on type
Handle data transformations
Support nested structures
Maintain accessibility
Generate appropriate data fetching logic
🗂 Related Elements
<text>
,<input>
,<image>
,<card>
,<listItem>
, etc.
Last updated