Build your own kit
This guide builds a small kit called tutorial, step by step. It starts as a copy of Plain, gets its own accent colour and font, and gains an invoice component that binds a Go type. Then it adds a template that uses the component, and tests that load the kit, render the template and compare it with golden files.
The finished kit is in the lttr repository as examples/tutorial. Every kit and Go snippet on this page is labelled with its path in that directory (tutorial/kit/kit.yaml, tutorial/tutorial.go), and the docs build checks that each one is byte for byte the file it names. What you copy here is what the tests run.
kit/ the kit: Plain's files, edited, plus components/invoice/
templates/invoice.md a template that uses the invoice component
tutorial.go the Go types, the embedded kit, the compiled template and its sample set
tutorial_test.go check, golden, typo and render tests
testdata/invoice.html, .txt the golden files
Start from Plain
lttr kit init copies Plain into a new directory and renames it. Flags go before the directory:
lttr kit init -name tutorial ./kit
wrote 29 files to ./kit; check it with: lttr kit check ./kit
Without -name, the kit is named after the directory. The copy is Plain exactly, apart from the name: line and the header comment of kit.yaml: the layouts, styles.css, blocks.html and blocks.txt, the six components (section, button, image, columns, column and footer), two images under assets/ and two samples with their data.
Check it straight away, so you know the starting point is clean:
lttr kit check ./kit
kit tutorial: 2 samples rendered, no problems
kit check loads the kit, which type-checks every template, then renders each samples/*.md with its data from samples/samples.yaml and lints the HTML. It exits 1 on any problem. See What is a kit.
Change the tokens
Tokens are the kit's design values. Plain's templates read them by name, with {{token "size.side"}} or {{style "color" "color.accent"}}, and never hard-code a colour, a font or a size, so most restyling happens in kit.yaml alone. The tutorial changes two things.
The accent colour, used for links, and the button colour both go from Plain's blue to green:
color.accent: { light: "#1A7F37", dark: "#3FB950" } # was Plain's blue
color.button: { light: "#1A7F37", dark: "#1A7F37" } # was Plain's blue
A colour token written { light: …, dark: … } has a value for each scheme. The light value is written into the HTML's inline styles, and the dark value goes into the dark-mode rules of styles.css. Any CSS colour works: #1A7F37, rgb(26 127 55), rgba(26,127,55,0.9) or hsl(135 66% 30%). Plain writes colours through the core style function ({{style "color" "color.accent"}}), which html/template accepts whatever the colour's syntax. Keep that pattern when you edit a template: a colour written straight into a style attribute, as color:{{token "color.accent"}};, is rejected when it holds ( and renders as ZgotmplZ, which lttr kit check reports.
The font stack changes from the system stack to Helvetica Neue:
# Quote family names with spaces in single quotes: "'Helvetica Neue',Arial,sans-serif".
font.sans: "'Helvetica Neue',Arial,sans-serif" # was the system stack
Quote a family name that has spaces in single quotes, inside a double-quoted YAML string. Plain writes font stacks through the core style function ({{style "font-family" "font.sans"}}), which accepts quoted names, so the stack reaches every style attribute intact. Token values may not contain <, >, {, }, ;, ", \ or control characters, because styles.css writes them into CSS unescaped. See kit.yaml.
Here is the whole change against Plain so far:
- color.accent: { light: "#2F6FEB", dark: "#4493F8" }
- color.button: { light: "#2F6FEB", dark: "#2F6FEB" }
+ color.accent: { light: "#1A7F37", dark: "#3FB950" } # was Plain's blue
+ color.button: { light: "#1A7F37", dark: "#1A7F37" } # was Plain's blue
color.on_button: { light: "#FFFFFF", dark: "#FFFFFF" }
color.border: { light: "#D1D9E0", dark: "#3D444D" }
color.subtle: { light: "#EFF2F5", dark: "#262C36" }
# Quote family names with spaces in single quotes: "'Helvetica Neue',Arial,sans-serif".
- font.sans: "-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
+ font.sans: "'Helvetica Neue',Arial,sans-serif" # was the system stack
Preview it while it is untyped
So far the kit binds no Go types, so the CLI can load it from disk. Run the studio and leave it open while you edit:
lttr serve -kit ./kit
lttr studio: serving kit (2 samples) on http://localhost:7070
The studio watches the whole kit (kit.yaml, the templates, styles.css and the samples), so a saved token shows in the open page within half a second, with no reload. The grid shows every sample, and each opens at 600 and 375 px, in light and dark, with its text part and its problems as file:line:col lines. See Studio.
This is the time to work on anything the samples show: tokens, layout.html, blocks.html and the existing components. The next step binds a Go type. After that the CLI can't load the kit any more, and you preview and check it from Go instead.
Add the invoice component
A component is a directory under components/ with a schema, an HTML template and, optionally, a text template. The invoice component shows an invoice's lines and total. It takes the invoice as a Go value, through a binding, rather than as text attributes.
The schema declares one attribute, one binding, no Markdown content and the component's spacing:
# An invoice: the bound Invoice's lines, then its total. A template
# passes the invoice with a binding: ::invoice{:invoice="invoice"}.
name: invoice
attrs:
title: { type: text, default: Invoice }
bindings:
invoice: { type: Invoice, required: true }
content: none
spacing:
top: size.block
bottom: size.gap
titleis atextattribute with a default, so::invoicealone renders "Invoice" and::invoice{title="Receipt"}changes it.invoiceis a binding. Itstype,Invoice, is a name the kit'stypeslist declares and Go registers (the next step).required: truemakes::invoicewithout:invoice="…"a compile error.content: nonemeans the component takes no Markdown between its fences.spacingsets the padding above and below. Values may be numbers of pixels or size tokens, as here.
See Component schemas for every key.
If lttr serve is still watching ./kit from the earlier step, saving this file shows an interim kit problem in the studio, above the last good renders: bindings.invoice: type "Invoice" is not in kit.yaml types. That is expected — Invoice isn't registered until Register the Go type, further down.
The HTML template renders one table row of the kit's message column. It executes with a kit.View: .Attrs holds the attributes, .Bind the bound values and .Section the resolved spacing:
{{- /* The title and number, one row per line (name, quantity, amount),
then the total. .Bind.invoice is an Invoice, so every field below is
checked against the Go type when the kit loads. */ -}}
<tr><td class="pl-px" align="left" style="padding:{{px .Section.Top}} {{token "size.side"}}px {{px .Section.Bottom}};">
<p class="pl-text" style="margin:0 0 8px;{{style "font-family" "font.sans"}}font-size:{{token "size.h2"}}px;line-height:{{token "size.h2_line"}}px;font-weight:600;{{style "color" "color.text"}}">{{.Attrs.title}} {{.Bind.invoice.Number}}</p>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse;">
{{- range .Bind.invoice.Lines}}
<tr><td class="pl-text pl-rule" align="left" style="padding:10px 0;{{style "border-bottom" (printf "1px solid %s" (token "color.border"))}}{{style "font-family" "font.sans"}}font-size:{{token "size.text"}}px;line-height:{{token "size.line"}}px;{{style "color" "color.text"}}">{{.Name}}</td>
<td class="pl-muted pl-rule" align="right" style="padding:10px 0 10px 12px;{{style "border-bottom" (printf "1px solid %s" (token "color.border"))}}{{style "font-family" "font.sans"}}font-size:{{token "size.text"}}px;line-height:{{token "size.line"}}px;{{style "color" "color.muted"}}white-space:nowrap;">× {{.Qty}}</td>
<td class="pl-text pl-rule" align="right" style="padding:10px 0 10px 12px;{{style "border-bottom" (printf "1px solid %s" (token "color.border"))}}{{style "font-family" "font.sans"}}font-size:{{token "size.text"}}px;line-height:{{token "size.line"}}px;{{style "color" "color.text"}}white-space:nowrap;">{{.Amount}}</td></tr>
{{- end}}
<tr><td class="pl-text" colspan="2" align="left" style="padding:10px 0 0;{{style "font-family" "font.sans"}}font-size:{{token "size.text"}}px;line-height:{{token "size.line"}}px;font-weight:600;{{style "color" "color.text"}}">Total</td>
<td class="pl-text" align="right" style="padding:10px 0 0 12px;{{style "font-family" "font.sans"}}font-size:{{token "size.text"}}px;line-height:{{token "size.line"}}px;font-weight:600;{{style "color" "color.text"}}white-space:nowrap;">{{.Bind.invoice.Total}}</td></tr>
</table>
</td></tr>
.Bind.invoice is an Invoice, so .Bind.invoice.Number, the range over .Bind.invoice.Lines and .Bind.invoice.Total are all checked against the Go type when the kit loads. Inside the range, the dot is a Line, so .Name, .Qty and .Amount are checked against that. The class names (pl-px, pl-text, pl-rule, pl-muted) are Plain's hooks for its mobile and dark-mode rules in styles.css, so the new rows follow the rest of the kit.
The text template gives the plain-text part its form of the invoice. It uses the text-only leaders and leader functions for dot-leader rows:
{{- /* The invoice as dot leaders. leaders lines its rows up in one
column; each row here is its own call, since a template cannot collect
rows in a loop, and short labels share the same column anyway. */ -}}
{{upper .Attrs.title}} {{.Bind.invoice.Number}}
{{range .Bind.invoice.Lines -}}
{{leaders (leader (printf "%s x%d" .Name .Qty) .Amount.String)}}
{{end -}}
{{leaders (leader "Total" .Bind.invoice.Total.String)}}
A component without text.tmpl has no text form, and its HTML stands alone. See Templates and views for the view types and every core function, and Plain text for how the text part is joined.
Register the Go type
A kit names the Go types its components may bind in kit.yaml. Put the types line at the top level, after dark: true:
# Go types components may bind. The kit's Go package registers each one
# with kit.Types, so this kit loads from Go, not from the CLI.
types: [Invoice]
The CLI has no way to know what Invoice is, so from here on it refuses to load the kit directory, and says why:
lttr kit check ./kit
kit/kit.yaml:14:9: types: "Invoice" is not registered
./kit: kit directories load without Go types; check kits that bind Go types from Go (see README)
The line number depends on the header comment above name:. kit init wrote a six-line header, so the types block lands after dark: true and a blank line, on line 14. The tutorial's shorter header in the repository puts it on line 12. lttr serve -kit ./kit shows the same error as a kit problem, and started afresh it shows only the kit-failure page, since the kit never loads.
The kit now lives in a Go package. tutorial.go, next to the kit/ directory, starts with its package clause and imports (net/mail is for the sample set, further down):
package tutorial
import (
"embed"
"fmt"
"io/fs"
"net/mail"
"sync"
"github.com/sulv-io/lttr"
"github.com/sulv-io/lttr/kit"
)
First the types: Invoice is what the component binds, and Data is the template's data, which carries an Invoice:
// Money is an amount in cents.
type Money int64
// String formats m in dollars, such as "$1250.00". Merge tags and kit
// templates both print a Money through it.
func (m Money) String() string {
sign := ""
if m < 0 {
sign, m = "-", -m
}
return fmt.Sprintf("%s$%d.%02d", sign, m/100, m%100)
}
// Line is one line of an invoice.
type Line struct {
Name string
Qty int
Amount Money // the line total
}
// Invoice is the Go type the kit's invoice component binds. kit.yaml lists
// it under `types`, and Kit registers it under the same name.
type Invoice struct {
Number string
Lines []Line
Total Money
}
// Data is the data of templates/invoice.md. Merge tags such as
// {{invoice.number}} and the :invoice="invoice" binding resolve against it.
type Data struct {
Invoice Invoice `json:"invoice"`
Due string `json:"due"`
PayURL string `json:"pay_url"`
}
Money implements fmt.Stringer, so {{.Amount}} in a kit template and {{invoice.total}} in a Markdown template both print $76.00, not 7600. A merge tag needs a scalar: a string or integer kind, or any fmt.Stringer.
Then the package embeds the kit directory and loads it with the type registered under the name kit.yaml uses:
// files holds the kit directory, kit/.
//
//go:embed kit
var files embed.FS
// Files returns the kit's files, rooted at kit/.
func Files() fs.FS {
sub, err := fs.Sub(files, "kit")
if err != nil {
panic(err) // "kit" is a valid path, so Sub cannot fail
}
return sub
}
// LoadKit loads the tutorial kit from fsys (a copy of kit/ on disk, say)
// with the Go types its components bind. A kit with `types` in kit.yaml
// loads only with every listed type registered. Kit() is
// LoadKit(Files()) cached.
func LoadKit(fsys fs.FS) (*kit.Kit, error) {
return kit.Load(fsys, kit.Types(kit.TypeOf[Invoice]("Invoice")))
}
// load is LoadKit, kept for callers within the package.
func load(fsys fs.FS) (*kit.Kit, error) { return LoadKit(fsys) }
// loadOnce loads the kit once, so every template and renderer shares the
// same immutable *kit.Kit.
var loadOnce = sync.OnceValues(func() (*kit.Kit, error) { return LoadKit(Files()) })
// Kit returns the loaded tutorial kit. It is safe for concurrent use and
// returns the same *kit.Kit on every call.
func Kit() (*kit.Kit, error) { return loadOnce() }
// MustKit is Kit that panics on error; the embedded kit is tested, so an
// error means a broken build.
func MustKit() *kit.Kit {
k, err := Kit()
if err != nil {
panic(err)
}
return k
}
kit.Load decodes every file, checks every cross-reference and statically checks every template, and it returns every problem at once, each with its kit file position. Loading once with sync.OnceValues matters: a template must be compiled against the same *kit.Kit the renderer uses. kits/plain and kits/quiet expose the same Files, Kit and MustKit trio. A kit that adds template functions passes kit.Funcs(…) to Load the same way. See Go types and funcs.
Write the template
The template is ordinary Comark. Loose Markdown goes into the kit's default component, section. The invoice component takes the invoice through a binding, :invoice="invoice", which names a path in the data:
---
template: invoice
profile: billing
subject: "Invoice {{invoice.number}}"
preheader: "{{invoice.total}} due by {{due}}."
---
# Your invoice
Hi {{name | there}}, here is invoice {{invoice.number}} for September.
::invoice{:invoice="invoice"}
::
::section
Please pay by {{due}} to keep your plan active.
:button[Pay {{invoice.total}}]{href="{{pay_url}}"}
::
::footer{note="Questions about this invoice? Reply to this email."}
::
profile: billing names the sender profile, which the renderer supplies. {{name | there}} falls back to "there" when the recipient has no name. ::section and ::footer are Plain's components, still in the kit. See Comark syntax and Merge tags and data.
The package compiles the template once, at init, against its kit:
// invoiceSource is the invoice template.
//
//go:embed templates/invoice.md
var invoiceSource []byte
// invoice is compiled once, at init, against the kit: a broken template
// stops the program at startup, never at send time.
var invoice = lttr.MustCompile[Data](MustKit(), "invoice", invoiceSource)
// Template returns the compiled invoice template.
func Template() *lttr.Template[Data] { return invoice }
Compile checks every merge tag and binding against Data, and every component and attribute against the kit's schemas. Misspell a field in the template, {{invoice.totl}} on line 18, and the package fails to initialise:
panic: invoice:18:13: unknown field "totl" in tutorial.Invoice (did you mean invoice.total?)
A binding must have exactly its registered type. :invoice="due" binds a string:
panic: invoice:12:1: invoice: :invoice is string, want tutorial.Invoice
Test it from Go
A kit that binds Go types is checked by its package's tests. They start from one description of "this template, with this data": an lttr.SampleSet, which holds the kit, the Config to render with and the samples. The tutorial's Set puts the invoice template in it, with typed data and a recipient:
// Set returns the tutorial as a sample set: the kit, a Config with the
// "billing" profile the template names, and the invoice template with
// typed sample data, rendered for ada@example.com.
func Set() *lttr.SampleSet {
k := MustKit()
return <tr.SampleSet{
Kit: k,
Config: lttr.Config{
Kit: k,
Profiles: []lttr.Profile{{
Name: "billing",
From: mail.Address{Name: "Example Billing", Address: "billing@example.com"},
}},
},
Samples: []lttr.Sample{
lttr.NewSample("invoice.md", invoiceSource, sampleInvoice(), lttr.Recipient{Address: "ada@example.com", Name: "Ada"}),
},
}
}
// sampleInvoice is the data the tutorial's invoice is shown with.
func sampleInvoice() Data {
return Data{
Invoice: Invoice{
Number: "INV-0042",
Lines: []Line{
{Name: "Team plan, September", Qty: 1, Amount: 4900},
{Name: "Extra seats", Qty: 3, Amount: 2700},
},
Total: 7600,
},
Due: "9 October",
PayURL: "https://example.com/billing/INV-0042",
}
}
lttr.NewSample keeps the data's Go type, so the sample compiles against Data, exactly as MustCompile[Data] does. A set can hold samples of different data types, and the same set feeds lint.Check, lint.Golden and your own previews.
tutorial_test.go is in the same package. It starts with its imports and the -update flag the golden test reads:
package tutorial
import (
"flag"
"io/fs"
"net/mail"
"strings"
"testing"
"testing/fstest"
"github.com/sulv-io/lttr"
"github.com/sulv-io/lttr/lint"
)
var update = flag.Bool("update", false, "rewrite the golden files in testdata/")
github.com/sulv-io/lttr/lint is lttr's HTML lint, the check lttr kit check runs. It is a public package, so your own module imports it the same way.
lint.Check compiles and renders every sample in a set, lints each HTML part, and returns every problem with its position, as file:line:col: message:
// TestCheck runs lint.Check over the tutorial's sample set (Set): the
// invoice, with its typed data, compiles, renders and lints clean.
func TestCheck(t *testing.T) {
for _, p := range lint.Failures(lint.Check(Set())) {
t.Error(p) // file:line:col: message
}
}
A golden test pins the output. lint.Golden renders each sample and compares its HTML and text with testdata/<template name>.html and .txt, here testdata/invoice.html and testdata/invoice.txt. With -update it writes them instead, so any change to the kit or the template shows up as a diff you review:
// TestGolden compares the render of each sample in Set with its golden
// files, testdata/invoice.html and .txt. After a change to the kit or the
// template, run
//
// go test ./examples/tutorial -run Golden -update
//
// and review the diff: every changed line is a change recipients see.
func TestGolden(t *testing.T) {
lint.Golden(t, Set(), "testdata", *update)
}
A render that differs from its golden fails with a line diff:
--- FAIL: TestGolden (0.00s)
--- FAIL: TestGolden/invoice (0.00s)
tutorial_test.go:52: invoice.md: the render differs from testdata/invoice.txt; run with -update and review the diff:
--- testdata/invoice.txt
+++ render
@@ -10,1 +10,1 @@
-Extra seats x2 .................. $27.00
+Extra seats x3 .................. $27.00
The text golden is the plain-text part a recipient sees:
Example
YOUR INVOICE
Hi Ada, here is invoice INV-0042 for September.
INVOICE INV-0042
Team plan, September x1 ......... $49.00
Extra seats x3 .................. $27.00
Total ........................... $76.00
Please pay by 9 October to keep your plan active.
Pay $76.00:
https://example.com/billing/INV-0042
--
Questions about this invoice? Reply to this email.
Example Inc. · 100 Main Street, Springfield
In the lttr repository, the tutorial's tests run like this:
go test -v -run 'Check|Samples|Golden|Typo' ./examples/tutorial/
=== RUN TestCheck
--- PASS: TestCheck (0.00s)
=== RUN TestSamples
--- PASS: TestSamples (0.01s)
=== RUN TestGolden
=== RUN TestGolden/invoice
--- PASS: TestGolden (0.00s)
--- PASS: TestGolden/invoice (0.00s)
=== RUN TestTypo
--- PASS: TestTypo (0.00s)
=== RUN TestCheckTypo
--- PASS: TestCheckTypo (0.00s)
PASS
ok github.com/sulv-io/lttr/examples/tutorial 0.030s
TestSamples runs lint.Check over the samples Plain came with, built from samples/*.md and samples/samples.yaml by lttr.KitSamples: the check lttr kit check would run if the kit loaded without Go types. TestCheckTypo misspells a merge tag and checks that lint.Check reports it at invoice.md:18, with (did you mean pay_url?). Copy all of them into your own module. Before the types line goes in, lttr kit check does the same from the command line. See Goldens and testing.
Preview it from Go
The studio can't load the kit from the CLI any more either. Run it from Go instead, with the studio package and the same sample set. examples/tutorial/cmd/emaildev is the whole program: it serves tutorial.Set(), and reloads the kit (with tutorial.LoadKit, which registers Invoice) and the template from disk.
$ go run ./examples/tutorial/cmd/emaildev
lttr studio: serving tutorial (1 sample) on http://localhost:7070
Edits to the kit and to templates/invoice.md reload live; a change to the Go types or the sample data needs a restart. See Run it for your own Go types.
Catch a typo
Change .Bind.invoice.Total on line 13 of html.tmpl to .Bind.invoice.Totl. The kit no longer loads, and because MustCompile runs at init, nothing in the package does. Here the package is a module called example.com/tutorial:
go test .
panic: components/invoice/html.tmpl:13:243: Invoice has no field or method "Totl"
goroutine 1 [running]:
example.com/tutorial.MustKit()
/tmp/tutorial/tutorial.go:83 +0x48
example.com/tutorial.init()
/tmp/tutorial/tutorial.go:95 +0xb8
FAIL example.com/tutorial 0.016s
FAIL
The error names the kit file, the line and the byte column of the typo, and the Go type that has no such field. The column is large because the total row is one long line of email HTML. The mistake never reaches a render, let alone a recipient. TestTypo pins this exact message, so the check can't quietly stop working:
// TestTypo: a misspelt field on a bound type fails kit.Load, with the
// position of the typo in the kit file.
func TestTypo(t *testing.T) {
overlay := fstest.MapFS{}
err := fs.WalkDir(Files(), ".", func(path string, d fs.DirEntry, err error) error {
if err != nil || d.IsDir() {
return err
}
b, err := fs.ReadFile(Files(), path)
if err != nil {
return err
}
overlay[path] = &fstest.MapFile{Data: b}
return nil
})
if err != nil {
t.Fatal(err)
}
const tmpl = "components/invoice/html.tmpl"
src := string(overlay[tmpl].Data)
if !strings.Contains(src, ".Bind.invoice.Total") {
t.Fatalf("%s no longer shows .Bind.invoice.Total", tmpl)
}
overlay[tmpl].Data = []byte(strings.Replace(src, ".Bind.invoice.Total", ".Bind.invoice.Totl", 1))
_, err = load(overlay)
const want = `components/invoice/html.tmpl:13:243: Invoice has no field or method "Totl"`
if err == nil || err.Error() != want {
t.Errorf("load error = %v\nwant %s", err, want)
}
}
It copies the kit into an in-memory fstest.MapFS, breaks one field and loads the copy with the same load function the package uses. See Template checking for everything kit.Load checks.
Send it
The package is ready to use from any program. This one renders the invoice for Ada and prints the envelope and the text part:
package main
import (
"fmt"
"log"
"net/mail"
"github.com/sulv-io/lttr"
"github.com/sulv-io/lttr/examples/tutorial"
)
func main() {
r, err := lttr.NewRenderer(lttr.Config{
Kit: tutorial.MustKit(), // the kit the invoice template was compiled against
Profiles: []lttr.Profile{{
Name: "billing",
From: mail.Address{Name: "Example Billing", Address: "billing@example.com"},
}},
})
if err != nil {
log.Fatal(err)
}
m, err := tutorial.Template().Render(r,
lttr.Recipient{Address: "ada@example.com", Name: "Ada"},
tutorial.Data{
Invoice: tutorial.Invoice{
Number: "INV-0042",
Lines: []tutorial.Line{
{Name: "Team plan, September", Qty: 1, Amount: 4900},
{Name: "Extra seats", Qty: 3, Amount: 2700},
},
Total: 7600,
},
Due: "9 October",
PayURL: "https://example.com/billing/INV-0042",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s → %s: %s\n\n", m.From.Address, m.To.Address, m.Subject)
fmt.Print(m.Text)
}
billing@example.com → ada@example.com: Invoice INV-0042
Example
YOUR INVOICE
Hi Ada, here is invoice INV-0042 for September.
INVOICE INV-0042
Team plan, September x1 ......... $49.00
Extra seats x3 .................. $27.00
Total ........................... $76.00
Please pay by 9 October to keep your plan active.
Pay $76.00:
https://example.com/billing/INV-0042
--
Questions about this invoice? Reply to this email.
Example Inc. · 100 Main Street, Springfield
"Example" and "Example Inc. · 100 Main Street, Springfield" are Plain's kit vars, which the tutorial kit kept. Set your own per renderer with Config.Vars ({"brand": …, "company": …, "address": …}), or change their defaults in kit.yaml. To deliver the message, see SMTP.
Next steps
| To | Read |
|---|---|
Learn every kit.yaml key | kit.yaml |
| Give a component attributes, content rules or children | Component schemas |
| Use the view fields and core functions in templates | Templates and views |
| Keep the HTML working in Outlook and Gmail | Email-safe HTML |
| See a complete kit with 24 components | The Quiet kit |
Goldens and testing
make golden and reviewing its diffs, sample sets, the lint package, make check, fuzzing, the coverage floor, and testing your own kit's templates.
The Quiet kit
The design lttr started with, as a kit — its 24 components, spacing rules, brand vars and profile-driven footers, and Loam, the nine example emails built on it.