Components
Core Component Attributes
Every UDML component supports these standard attributes for consistent behavior and styling. Components define their base structure and variations through complete structural definitions, allowing the AI to identify and apply differences automatically.
🛠Standard Attributes
variant
string
No
Visual style variant of the component
size
string
No
Size variant of the component
state
string
No
Current state of the component
style
string
No
Additional style overrides
ai-hint
string
No
Context for AI interpretation
Component Definition Structure
Components are defined using a <component>
element containing:
A
<base>
element defining the default structure<variant>
elements for style variations<size>
elements for size variations<state>
elements for state variations
Usage Examples
🧩 AI Interpretation Guidelines
Component Rendering
Start with the base structure
Apply size variations if specified
Apply style variations if specified
Apply state variations if specified
Apply any custom style overrides
Apply AI hints for context
Variation Application
Compare complete structures to identify differences
Apply differences in a cascading manner
Handle conflicts based on priority (state > variant > size > base)
Maintain structural integrity
Preserve accessibility attributes
Attribute Priority
State attributes (highest priority)
Variant attributes
Size attributes
Base attributes (lowest priority)
Custom style overrides (applied last)
Best Practices
Define complete structures for each variation
Maintain consistent element naming
Include all necessary attributes in each variation
Consider accessibility in all variations
Document expected behavior in ai-hint
Common Variations
Size Variations
small
: Compact versionmedium
: Default sizelarge
: Expanded version
State Variations
default
: Normal statehover
: Mouse over statefocus
: Keyboard focus stateactive
: Being interacted withdisabled
: Non-interactive stateloading
: Processing state
Style Variations
primary
: Main action stylesecondary
: Alternative styletertiary
: Subtle styledanger
: Error/warning stylesuccess
: Positive action style
Last updated