Coral UI
@reallygoodwork/coral-core

@reallygoodwork/coral-core

Core utilities, schemas, and CLI for the Coral specification format.

npm

Core utilities, schemas, and CLI for the Coral specification format. This package provides the foundational types, Zod schemas, utility functions, and CLI tools for working with Coral UI specifications.

What is Coral?

Coral is a specification format for describing UI components in a framework-agnostic way. It enables you to define component structure, styling, variants, interactivity, and responsive behavior in a portable JSON format that can be transformed into various output formats (HTML, React, Vue, etc.).

Features

Installation

npm install @reallygoodwork/coral-core
pnpm add @reallygoodwork/coral-core
yarn add @reallygoodwork/coral-core

Quick Start

import { parseUISpec, transformHTMLToSpec } from '@reallygoodwork/coral-core'

// Parse and validate a specification
const spec = await parseUISpec({
  name: 'Button',
  elementType: 'button',
  styles: { padding: '10px', backgroundColor: '#007bff' },
})

// Or transform HTML to Coral spec
const htmlSpec = transformHTMLToSpec('<button class="btn">Click me</button>')

Documentation

API Reference

Concept Guides

For in-depth explanations of core concepts, see:

On this page