core Svelte Themes

Core

DeclareUI — Core meta-framework: YAML/JSON parser, AST, validators, and multi-target code generators.

DeclareUI DeclareUI

@declareuihq/core

The engine behind DeclareUI — parser, schema validator, AST, and multi-target code generators.


What it does

@declareuihq/core takes .ui.yaml (or .ui.json) component declarations and compiles them into native, idiomatic code for any supported framework:

  • React — functional components with hooks, proper JSX
  • Vue — Composition API with <script setup>
  • Angular — standalone components with signals
  • Svelte — runes-based .svelte files
  • Web Components — Custom Elements with Shadow DOM
  • Vanilla JS/TS — framework-free, zero dependencies

Installation

pnpm add @declareuihq/core

Usage

import { parse, validate, generate } from '@declareuihq/core';

// Parse a .ui.yaml file into AST
const ast = parse('button.ui.yaml');

// Validate against the DeclareUI schema
const result = validate(ast);

// Generate native code for target frameworks
const output = generate(ast, {
  targets: ['react', 'vue', 'svelte'],
  typescript: true,
});

Architecture

.ui.yaml → Parser → AST → Validator → Code Generator → Native Code
                                              ↓
                                    React | Vue | Angular | Svelte | WC | Vanilla
Package Description
@declareuihq/cli CLI tool for building and managing components
@declareuihq/mcp MCP server for AI-driven component development
@declareuihq/components Pre-built component library
@declareuihq/tailwind-plugin Tailwind CSS integration

Contributing

See CONTRIBUTING.md for guidelines.

License

MIT

Top categories

Loading Svelte Themes