Getting Started with yamlCase

This guide explains YAML views and generated React output. Compilation is managed by yamlCase; the compiler is not distributed for customer installation. Public browser compilation is not open on this website yet.


Choose Your Path

Path A: Online Editor (coming soon)

Explore the YAML examples first. Compiling them requires approved yamlCase access.

Step 1: Open the Playground

Public browser compilation is coming soon. The examples below explain the workflow; they do not provide compiler access.

Step 2: Write Your First View

Paste this into the YAML editor:

view:
  name: MyFirstApp
  title: Hello World
  body:
    - type: heading
      text: Hello, yamlCase!
      level: 1
    - type: text
      content: This is my first view.
      variant: lead
    - type: card
      title: Quick Stats
      body: Everything is defined in YAML.

Step 3: Compile

With approved yamlCase access, submit your YAML for compilation and retrieve the generated React/TypeScript output.

Step 4: Experiment

Try changing the heading text or adding components. Regenerate through approved yamlCase access to review changes in React output.

That is it! You are now building React apps with YAML. Explore the Templates and Advanced tutorials to learn more.


Source and Output

Path B: Understand the Source and Output

Keep your YAML source in your project. Compilation is managed by yamlCase; public API and MCP integrations are planned.

Step 1: Check Compiler Access

The yamlCase compiler is controlled by yamlCase. This website does not currently provide public compilation access.

bashCompiler Access
# Workflow overview; this is not a compiler installation command.
# 1. Prepare your YAML source.
# 2. Use approved yamlCase compilation access.
# 3. Review and test the generated React output.

You can edit YAML in your preferred text editor. Running generated React output does not require distributing the yamlCase compiler.


Step 2

Step 2: Create a New Project

A generated project can contain React, TypeScript, routing and styles. The structure below illustrates output from the controlled compilation workflow.

bashScaffold a Project
# After retrieving a generated React project:
cd my-dashboard
npm install

This creates the following project structure:

textProject Structure
my-dashboard/
├── src/
│   ├── views/              # Your YAML view definitions go here
│   │   └── dashboard.yaml  # Sample view (auto-generated)
│   ├── components/         # Generated TSX output (do not edit!)
│   └── main.tsx            # App entry point (auto-generated)
├── yamlcase.config.yaml   # Project configuration
├── package.json            # Node.js dependencies
└── tsconfig.json           # TypeScript config
Important

Never edit files in src/components/ directly — they are regenerated on every build. All your work goes in src/views/ as YAML files.


Step 3

Step 3: Write Your First View

A view is a YAML file that defines a React component. Every view has a name and a body containing a tree of components.

Create a file called src/views/hello.yaml:

yamlsrc/views/hello.yaml
view:
  name: Hello
  title: Hello World
  body:
    - type: heading
      text: Hello, yamlCase!
      level: 1
    - type: text
      content: This is my first view.
      variant: lead
    - type: card
      title: Quick Stats
      body: Everything is defined in YAML.
    - type: grid
      columns: 3
      children:
        - type: stat_card
          label: Views
          value: "1"
        - type: stat_card
          label: Components
          value: "4"
        - type: stat_card
          label: Lines of YAML
          value: "18"

This single YAML file will generate a complete React component with imports, TypeScript types, and CSS.


Step 4

Step 4: Build and Preview

bashBuild and Serve
# After approved compilation, run the generated React project.
npm install
npm run dev

# Run the checks supplied by your generated project before deployment.

Open your browser to http://localhost:5173 to see your app. The dev server supports hot module replacement so changes to generated files appear instantly.

Watch Mode

After approved compilation, you can run and test the generated React project with its supplied package scripts. Changes to YAML require another compilation through yamlCase.


Step 5

Step 5: Multi-View Applications

For apps with multiple pages, assembly combines views into routes. Navigation options are part of the configuration submitted through approved compiler access.

bashAssembly with Navigation
# Example navigation configuration for managed compilation
project:
  name: my-dashboard
  routing: sidebar  # sidebar | tabs | router

You can also set the routing mode in your config file so it persists across builds. The config also controls navigation order, project name (shown in sidebar title), and global CSS.

yamlNavigation & Routing Configuration
# yamlcase.config.yaml
project:
  name: my-dashboard
  routing: sidebar          # sidebar | tabs | router
  views_order:
    - welcome
    - dashboard
    - settings
    - profile
  global_css:
    - showcase.css          # Global styles applied to all views

Adding Styles

Step 6: Adding Custom Styles

Every view can include custom CSS defined directly in YAML. Styles are scoped to the view and compiled into a separate CSS file.

yamlInline Styles in YAML
view:
  name: StyledPage
  title: My Styled Page
  styles:
    .hero-banner:
      background: "linear-gradient(135deg, #667eea, #764ba2)"
      color: white
      padding: 4rem 2rem
      text-align: center
      border-radius: var(--radius-lg)
    ".hero-banner h1":
      font-size: 3rem
      margin-bottom: 1rem
    ".hero-banner p":
      font-size: 1.25rem
      opacity: 0.9
  body:
    - type: container
      className: hero-banner
      children:
        - type: heading
          text: Welcome
          level: 1
        - type: text
          content: A beautifully styled hero section

CSS-in-YAML Rules

• Selectors are YAML keys: .class-name, #id, tag

• Properties are key-value pairs: padding: 2rem

• Quote values with special chars: color: "#667eea"

• Nested selectors use quotes: ".parent .child"

• Media queries: "@media (max-width: 768px)"

Style Tips

• Use className on components to apply styles

• Styles are scoped — no conflicts between views

• Global CSS via global_css in config file

• Combine with dark mode via CSS variables

• See Advanced tutorial for theming patterns


Adding Interactivity

Step 7: Adding Interactivity

Make your views interactive with state variables and event handlers. State is defined in the view header, and handlers are JavaScript/TypeScript functions.

yamlCounter Example
view:
  name: Counter
  title: Counter App
  state:
    count: "0"              # Initial value (number)
    name: "'World'"         # Initial value (string, note the quotes)
  handlers:
    - name: handleIncrement
      params: "()"
      body: setCount(prev => prev + 1);
    - name: handleReset
      params: "()"
      body: |
        setCount(0);
        setName('World');
  body:
    - type: heading
      text: "Hello, {name}!"
      level: 2
    - type: text
      content: "Count: {count}"
    - type: flex
      gap: 8
      children:
        - type: button
          text: Increment
          on_click: handleIncrement
        - type: button
          text: Reset
          variant: outline
          on_click: handleReset

State Syntax

• Numbers: count: "0"

• Strings: name: "'hello'" (quotes inside quotes)

• Booleans: isOpen: "false"

• Arrays: items: "[]"

• Use {variableName} in content to display values

Handler Syntax

• name: function name (used in on_click etc.)

• params: TypeScript function signature

• body: JavaScript code to execute

• Setters auto-generated: setState for state var

• Async handlers: params: "async ()"


CLI Reference

Managed Compilation Workflow

ActionDescription
Write YAMLDefine views, styles and templates in your source files
Approved compilation accessyamlCase controls compiler access; public compilation is not open on this website
Review React outputInspect generated TSX and styles, then run your project checks
Develop and deployUse standard React tooling for the generated application

Configuration

Configuration File

The yamlcase.config.yaml file controls project settings. Here are the key options.

yamlyamlcase.config.yaml
project:
  name: my-dashboard           # Project name (shown in sidebar title)
  routing: sidebar             # Navigation mode: sidebar | tabs | router
  views_order:                  # Navigation link order
    - welcome
    - dashboard
  global_css:                   # CSS files to import in all views
    - theme.css
  template_dirs:                # Additional template directories
    - ./my-templates
compiler:
  output_dir: src/components    # Where to write generated TSX
  css_modules: false            # Use CSS Modules (default: false)
  strict_mode: true             # Fail on unknown component types

Troubleshooting

Common Issues & Troubleshooting

YAML Indentation Errors

YAML is indentation-sensitive. Use 2 spaces, not tabs. Check indentation before submitting your source for validation.

Unknown Component Type

If you see 'Unknown component: xyz', check its spelling against the component gallery and review any validation feedback.

TypeScript Errors After Build

Type-check generated code in your React project. Check required props and validation feedback; report persistent errors with a minimal YAML example.

Styles Not Applying

Make sure your CSS selectors match the className on your components. Remember to quote selectors with special characters. Check that styles: is a YAML mapping (not a pipe string).

State Not Updating

State values must be quoted strings of JavaScript expressions: count: "0" not count: 0. String values need inner quotes: name: "'hello'" not name: hello. Check that handler body uses the correct setter name.


Deployment

Deploying Your App

yamlCase generates standard React + Vite projects. Deploy anywhere that supports static sites or Node.js.

Vercel

npm run build
npx vercel

Zero-config deployment. Automatic HTTPS and CDN.

Netlify

npm run build
npx netlify deploy --prod

Git-connected deploys with preview URLs.

GitHub Pages

npm run build
npx gh-pages -d dist

Free hosting for public repositories.

Online Editor Export (coming soon)

Keep your YAML source, compile through approved yamlCase access, then review and test the generated React output before deployment. Public compilation access is not open on this website yet.


Next Steps

Next Steps

Now that you have a working project, explore the other sections of this documentation.

YAML Spec

Learn the full YAML format including view structure, component types, props, and nesting.

Templates

Create your own reusable components defined entirely in YAML. Props, slots, and conditionals.

Advanced

CSS-in-YAML, state management, theming, dark mode, event handlers, and configuration.

Page Templates

Browse complete page layouts — dashboards, landing pages, blogs, settings, portfolios.