Milda language 0.10 · docs

Design your system once.
Generate it everywhere.

Learn how to model a design system once, work with it through the Studio and tooling, and ship it as real, versioned code.

One file in, real code out

A component from the tour, and the React the generator made of it when this page was built. Nothing on the right was written by hand: change the file and the code follows.

How generation works
component Button "The primary action." {
  archetype Button

  props {
    label : string = "Get started"
  }

  events {
    click
  }

  part Button: container {
    emits { click on activate }
    layout { stack row; gap space.sm; align center; distribute center }
    fill accent
    ink on-accent
    corner radius.sm
    inset space.sm space.lg
  }

  part label: text {
    slot of content default
    content bind label
    text size.md
    weight weight.medium
  }
}

Where to start

Pick the question you came with.

New to Milda

What it is, the ideas behind it, then one system built a lesson at a time.

You know CSS

Every CSS property you know, the Milda word for it, and why it is spelled that way.

You were handed a library

You were handed a package. Install it, theme it, and let your editor and agent read it.

Looking something up

Every statement, every blueprint, and one word for each thing.

Learn by building

One design system, built up a lesson at a time. Every lesson is a file that opens in the Playground.

Start the tour
  1. 01A file and a tokenThe smallest complete system: a header, a name, and three typed values.
  2. 02Layers and contextBase tokens hold the literals; semantic tokens alias them, per colour scheme.
  3. 03A first componentA Button from the archetype: a contract, two parts, and facets that point at tokens.
  4. 04Variants and statesA prop that is a dimension, paint per variant, and paint per behaviour state.
  5. 05The contractProps with types, defaults, prose and conditions; events, and the parts that raise them.
  6. 06Anatomy: parts, kinds and slotsWhat a part is, how parts nest by path, when a part is present, and what a slot promises.
  7. 07Composition: instances and groupsA Badge, then a Card built from Button and Badge, and the library filed into groups.
  8. 08Inputs and behaviourA TextField, a Switch and a Dialog: value bindings, emitted events, and what the archetype brings.
  9. 09LayoutStacks, gaps, alignment and per-axis sizing, in the propose/choose model.
  10. 10Type, motion and computed valuesA font family and text styles, a transition, and a hover colour derived from the accent.
  11. 11Usage rulesHow the system says how it is meant to be used: constraints in the contract, rules over the usage tree.
  12. 12Docs, examples, assets and iconsThe system carries its own documentation, demo scenes, assets and icon library.
  13. 13From file to libraryGenerate, release, install: what the React generator makes of the file, and how a version is chosen.
  14. 14One system, many surfacesThe same document in Figma, in the CLI and in an agent, and what "could not express" means.

The language

What a .milda file can say, one idea per page.

Language overview