← All examples
01

Canonical Grid model

Canonical Foundations

Small portable model that demonstrates the canonical authoring profile.

Scale
Small
Source
01-foundations.grid
Length
30 lines
Collection
Start here
Level
Beginner
Runtime
Portable
Version
1.0.0

Watch it in Grid

See this model in motion.

Watch the model respond in the product, then inspect the exact source and checkpoints on this page.

Companion film

From blank to living model

Turn a plain-text model into a live grid, then change one input and watch every dependent value—and the judgment—recompute.

28 secGrid 0.61.0
Open film page

What this model gives you

A typed profitability model with a calculated fallback, status, semantic signal, and live summary.

15 min to study · Source reviewed 2026-08-24

Continue with guided practice

What to notice

  • Typed cells and literals
  • Local DO bindings
  • DEFAULT overrides
  • Readable branching

Requirements

  • Portable
  • No connector
  • No network

Expected checkpoint

A known state for this walkthrough.

After loading the canonical source with its authored starting values.

Margin
39,000B1
Tax due
7,665B5
Status
watchC1
Signal
:amberC2
01 · Inputs

Meaning travels with the value

Currency and percentage tags make the model readable without changing ordinary arithmetic.

02 · Derivations

Names clarify intermediate work

The DO expression keeps margin and deduction local while exposing one durable result.

03 · Decision

Fallback and classification stay reactive

A blank override reveals the calculated tax; status and semantic color update from the same dependency cone.

01-foundations.grid
Get Grid
MODEL "Canonical Foundations"
DESCRIPTION "Small portable model that demonstrates the canonical authoring profile."
VERSION "1.0.0"
AUTHOR "Grid Team"
TAGS "canonical", "portable", "foundational"

# Inputs
A1 IS currency = 125000
A2 IS currency = 86000
A3 IS percentage = 21pct
A4 IS percentage = 5pct
A5 = BLANK

# Core derivations
B1 IS currency = A1 - A2
B2 IS currency = A1 * (1 - A4)
B3 IS currency = DO
  margin = B1
  deduction = 2500
  MAX(margin - deduction, 0)
END
B4 IS currency = B3 * A3
B5 IS currency = A5 DEFAULT B4

# Readable branching
C1 = B1 > 50000 THEN "strong" ELSE "watch"
C2 = MATCH(C1, "strong" -> :green, "watch" -> :amber, _ -> :red)
C3 = `status={C1} tax_due={B5}`

END MODEL