Glossary

Milda uses one word for each thing. This page defines each one, shows how it is spelled in a .milda file when it has a spelling, and names the other words you may have met for it elsewhere, so a reader coming from another tool finds the right page.

Two words are deliberately absent from the user-facing pages: IR and AST. Both name the same thing, the Milda document, from the compiler's side. They appear only on the pages for people implementing a reader or a generator.

.milda file

The document written as text. One file carries the whole system, every reference in it is by name, and reading it back gives the same document (a lossless round trip).

Also called
DSL, surface syntax
Read more
/language/file

alias

A token value that points at other tokens, one per context of a group, with a default. A token with no alias of its own still resolves through the aliases of the tokens it points at.

In a file
alias by ColorScheme { default -> white; Dark -> gray.900 }
Read more
/language/tokens

anatomy

The tree of parts a component is made of. An archetype publishes one; the author may add parts within what the content model allows.

Also called
structure, node tree
Read more
/language/parts

archetype

A built-in blueprint from the prelude - Button, SingleSelect, Dialog - with an invariant contract, a published anatomy and a composition of behaviours. A component starts from one and keeps its guarantees.

In a file
archetype Button
Read more
/language/archetypes

behaviour

A formal interaction state machine from the prelude - toggle, selection, presentation, browse, dismiss - with the states it emits. Archetypes compose them; the file can also name them.

In a file
uses selection.single as S
Also called
atom, primitive
Read more
/language/behaviors

component

One entry of the library: a contract, an anatomy of parts, and the archetype it starts from.

In a file
component Button { }
Read more
/language/parts

computed value

A token derived from another one by steps - lighter, scaled, rounded - that follows the base when it changes.

In a file
compute accent in oklch { darken 10% }
Read more
/language/values

context group

A dimension a token can answer differently along, such as colour scheme, density, platform or brand. Its members are contexts.

In a file
context-group ColorScheme { Light Dark }
Also called
theme dimension, mode
Read more
/language/tokens

contract

The public surface of a component: its props with types, defaults and constraints, and its events. The contract is the component’s identity, and a release’s version is computed from how it changed.

In a file
props { } events { }
Also called
interface, API
Read more
/language/parts

event

An output of a component, declared in the contract and raised by a part on an interaction.

In a file
events { click }
Read more
/language/parts

example

A demo scene: a composition of components with its own variables, shown in the docs and the preview, with no contract of its own.

In a file
example "Primary" for Button { }
Also called
demo scene, story
Read more
/language/library

facet

An abstract paint slot on a part - fill, ink, border, corner, inset, elevation, ring - that points at a token. There are no CSS properties in the language; each target maps facets to its own primitives.

In a file
fill accent
Also called
style property
Read more
/language/styling

foreign content

Code written for one specific target, quarantined in the file with its target tag. A reader that does not implement the target must skip it, so the rest of the system stays portable.

In a file
foreign web-react "Sparkline" "<Sparkline />"
Also called
escape hatch
Read more
/language/file

foundations

The value layer of a system: its tokens, arranged in layers, with the context groups they can answer along.

In a file
foundations { }
Also called
design tokens, theme
Read more
/language/tokens

generator

The program that produces a target’s output from the document. The React generator emits components and a theme; the Figma generator emits variables and component sets.

Also called
back-end, emitter
Read more
/concepts/generators

instance

A part that is another component of the library, nested, with its props fixed or bound to the outer component’s props.

In a file
instance Badge { tone = bind tone }
Read more
/language/parts

interface constraint

A rule decided from one instance of a component, written in its props block: required, required when, one-of, any-of, exclusive. The generated types enforce it where a type can.

In a file
required when loading
Read more
/language/usage

kind

What a part is, in neutral terms: container, item, text, control, input, icon, content, instance. The platform element is the target’s decision and is never in the file.

In a file
part icon: icon
Read more
/language/parts

layer

A named group of tokens in reading order: Base holds the literals, Semantic aliases them by role, and a component layer may alias those again. Resolution chains downward through the layers.

In a file
layer Semantic { }
Read more
/language/tokens

library

What surrounds the components in a system: their groups, the demo scenes, the asset library, the icon library and the documentation pages. All of it travels in the file.

In a file
group Forms, example, assets { }, icons { }, docs { }
Read more
/language/library

Milda document

A whole design system as one platform-neutral value: foundations, components, the library around them, and the rules for using it. Everything in Milda reads or writes this one document - the Studio, the Playground, the CLI, the MCP server and every generator.

Also called
IR, AST, canonical document
Read more
/language/document

part

One node of a component’s anatomy, addressed by its dotted path. A part has a kind, may carry content, a slot, bindings, emissions, facets, layout and states.

In a file
part Header.Title: text { }
Also called
node, element
Read more
/language/parts

Playground

play.milda.dev: a .milda file in the browser, read as you type, with the editor’s diagnostics and completion and a live view of the tokens and components it describes. No account.

Read more
/quickstart

prelude

The standard library of the language: the archetypes, behaviour atoms, facets, states and capabilities every system builds from. Authors use it; they do not define it.

In a file
prelude 0.0.2
Read more
/language/archetypes

prop

A typed input of a component. It can have a default, be required always or under a condition, and be typed by a context group so that it selects tokens.

In a file
label : string = "Save"
Read more
/language/parts

realization

How a target turns the neutral document into its own primitives: which element a kind becomes, how a state machine runs, what a facet maps to. Divergence between platforms lives here, never in the document.

In a file
realize web { }
Read more
/concepts/generators

release

A versioned, reproducible package built from the document and published to a registry. Its version is derived from the contract diff against the previous release.

Read more
/concepts/release

slot

A part the consumer fills: the label of a button, the items of a menu. Its arity and content contract are part of the component’s public API.

In a file
slot of content default
Read more
/language/parts

state

An interaction condition a part can be in - hovered, pressed, selected, open, disabled - emitted by a behaviour, never by a platform pseudo-class. Paint can differ per state.

In a file
state hovered { fill accent-hover }
Read more
/language/behaviors

Studio

The visual editor at milda.app, where people author the document. One of the two front-ends; the .milda text is the other.

surface version

The version of the grammar a file is written in. It is bumped whenever the text can say something new, so a reader can tell "this file predates motion" from "this file has no motion".

In a file
milda 0.10
Read more
/language/file

target

An output a project produces: React, Figma, and more as they ship. Targets are chosen per project and live outside the document.

Read more
/concepts/targets

the language

What a .milda file can say: the grammar of the text and the prelude of built-in words. It has a surface version (the grammar) and a prelude version (the vocabulary).

In a file
milda 0.10 / prelude 0.0.2
Read more
/language

token

A named, typed value: a colour, a spacing, a duration. The type decides what the value means, and every facet points at a token rather than at a literal.

In a file
token space/sm : spacing = 8px
Read more
/language/tokens

usage rule

How the system is meant to be composed, decided over the instances a consumer writes: how many, inside what, from which tokens, through which component. Each has an id, a severity and a reason.

In a file
rule one-primary-action error { }
Read more
/language/usage