UXSCII Schema Reference Guide

Complete reference for uxscii component schema and format specifications

Overview

UXSCII uses a two-file system for component definitions:

Required Fields

{
  "id": "component-name",           // kebab-case, 2-64 chars
  "type": "button|input|card|...",  // component type
  "version": "1.0.0",               // semantic version
  "metadata": { ... },              // metadata object
  "props": { ... },                 // component properties
  "ascii": { ... }                  // ASCII template config
}

Metadata Section

The metadata object contains descriptive information about the component:

Field Type Required Description
name String Yes Human-readable component name (1-100 chars)
created String Yes ISO 8601 timestamp of creation
modified String Yes ISO 8601 timestamp of last modification
description String No Component purpose (max 500 chars)
author String No Author/organization (max 100 chars)
tags Array No Searchable tags (max 10)
category String No Component category

Example:

{
  "metadata": {
    "name": "Primary Button",
    "description": "A primary action button with emphasis styling",
    "author": "UXSCII Team",
    "created": "2024-01-01T00:00:00Z",
    "modified": "2024-01-15T10:30:00Z",
    "tags": ["button", "primary", "action"],
    "category": "input"
  }
}

Properties Section

The props object contains component configuration values that can be substituted into templates:

{
  "props": {
    "text": "Button",
    "disabled": false,
    "size": "medium",
    "fullWidth": false,
    "ariaLabel": ""
  }
}

Properties can be any valid JSON type: string, number, boolean, array, or object.

Behavior Section (Optional)

Defines component states, interactions, animations, and accessibility:

States

{
  "behavior": {
    "states": [
      {
        "name": "default",
        "properties": {
          "background": "primary",
          "textColor": "white"
        }
      },
      {
        "name": "hover",
        "properties": {
          "background": "primary-dark"
        },
        "triggers": ["mouseenter"]
      }
    ]
  }
}

Interactions

{
  "interactions": [
    {
      "trigger": "click",
      "action": "emit-click-event",
      "target": "parent",
      "condition": "key === 'Enter'"
    }
  ]
}

Accessibility

{
  "accessibility": {
    "role": "button",
    "focusable": true,
    "keyboardSupport": ["Enter", "Space"],
    "ariaLabel": "{{ariaLabel || text}}"
  }
}

Layout Section (Optional)

Defines component layout properties:

{
  "layout": {
    "display": "inline-block",
    "positioning": "static",
    "spacing": {
      "margin": { "top": 1, "right": 2, "bottom": 1, "left": 2 },
      "padding": 16
    },
    "sizing": {
      "width": 200,
      "height": "auto",
      "minWidth": 100,
      "maxWidth": 400
    }
  }
}

ASCII Configuration

The ascii object configures the template file and variables:

Field Type Required Description
templateFile String Yes Template filename (must end with .md)
width Number Yes Component width in characters (1-120)
height Number Yes Component height in characters (1-50)
variables Array No Variable definitions with validation

Variable Definitions

{
  "ascii": {
    "templateFile": "button.md",
    "width": 16,
    "height": 3,
    "variables": [
      {
        "name": "text",
        "type": "string",
        "defaultValue": "Button",
        "description": "Button text label",
        "required": true,
        "validation": {
          "min": 1,
          "max": 20,
          "pattern": "^[a-zA-Z ]+$"
        }
      }
    ]
  }
}

Template File Format

Basic Structure

# Component Name

Component description.

## Default State

```
ASCII art representation using {{variables}}
```

## Variables

- `variableName` (type): Description

## Usage Examples

```
Example ASCII representations
```

Variable Syntax

Use {{variableName}} for variable interpolation:

ASCII Art Guidelines

Common patterns for visual hierarchy:

Validation Rules

Schema Validation

Template Validation

CLI Validation Commands

# Validate component schema
uxscii validate component.uxm

# Validate template syntax
uxscii template component.md

# Quality and best practices check
uxscii lint component.uxm --strict

# Test complete integration
uxscii uxm get component

Component Types

Standard component types:

Best Practices

  1. Use semantic IDs and clear naming
  2. Provide comprehensive accessibility configuration
  3. Include multiple interaction states
  4. Document all template variables
  5. Use consistent ASCII visual patterns
  6. Follow semantic versioning for updates
  7. Validate components before committing
  8. Include comprehensive metadata

← Full Specification | Agent Guide →