Guides

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.

Quiet is a calm, centred email design: a serif display face, a logo at the top, generous white space and a footer on a grey ground. It was lttr's only design before v0.2.0. Now it is a kit like any other, in the Go package github.com/sulv-io/lttr/kits/quiet, with 24 components, Go types for money, receipts, stock and products, and a few template functions of its own.

examples/quiet uses it for nine reference emails for Loam, a fictional farm-to-door marketplace. Those nine are lttr's conformance suite: their HTML and text are compared byte for byte with golden files, and they are the Quiet half of the Gallery.

Use it

Import the package and compile against quiet.MustKit(). The kit loads once, with its types and functions registered, and every call returns the same *kit.Kit:

main.go
package main

import (
    "fmt"
    "log"
    "net/mail"

    "github.com/sulv-io/lttr"
    "github.com/sulv-io/lttr/kits/quiet"
)

// OrderPacked is the template's data. The receipt component binds a
// quiet.Receipt, so the order field has exactly that type.
type OrderPacked struct {
    OrderID string        `json:"order_id"`
    Order   quiet.Receipt `json:"order"`
    Track   string        `json:"track_url"`
}

const src = `---
template: order.packed
profile: buyer
subject: "Order {{order_id}} is packed"
preheader: "It leaves the farm this afternoon."
---

::statement{eyebrow="Order {{order_id}}"}
# Packed and ready.

Your box leaves the farm this afternoon.

:button[Track delivery]{href="{{track_url}}"}
::

::receipt{:order="order"}
::

::signoff
::
`

var orderPacked = lttr.MustCompile[OrderPacked](quiet.MustKit(), "order.packed", []byte(src))

func main() {
    r, err := lttr.NewRenderer(lttr.Config{
        Kit:       quiet.MustKit(),
        Profiles:  []lttr.Profile{{Name: "buyer", From: mail.Address{Name: "Loam", Address: "orders@loam.example"}}},
        AssetBase: "https://loam.example/assets/email",
        Vars: map[string]string{
            "brand":   "Loam",
            "site":    "https://loam.example",
            "help":    "https://loam.example/help",
            "prefs":   "https://loam.example/preferences",
            "address": "12 Mill Lane, Alder Valley",
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    m, err := orderPacked.Render(r, lttr.Recipient{Address: "ada@example.com", Name: "Ada"}, OrderPacked{
        OrderID: "LM-2291",
        Order: quiet.Receipt{
            Lines: []quiet.ReceiptLine{
                {Name: "Autumn veg box", Detail: "Large", Qty: 1, Amount: quiet.USD(3400), Tone: quiet.ToneWarm},
                {Name: "Heritage apples", Detail: "2 kg", Qty: 2, Amount: quiet.USD(1180), Tone: quiet.ToneSea},
            },
            Fees:  []quiet.Fee{{Label: "Delivery", Amount: quiet.USD(500)}},
            Total: quiet.USD(5080),
        },
        Track: "https://loam.example/orders/LM-2291",
    })
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(m.Subject)
    fmt.Println()
    fmt.Print(m.Text)
}
Output
Order LM-2291 is packed

LOAM

ORDER LM-2291

Packed and ready.

Your box leaves the farm this afternoon.

Track delivery:
https://loam.example/orders/LM-2291

Autumn veg box x1 ............... US$34
Heritage apples x2 .............. US$11.80
Delivery ........................ US$5
Total ........................... US$50.80

Thanks,
The Loam team

Questions? Reply to this email or visit the Help Centre
(https://loam.example/help).

--
Loam · 12 Mill Lane, Alder Valley
Notification settings: https://loam.example/preferences

Three things are specific to Quiet:

  • Set AssetBase. The header shows logo.png, and logo-dark.png in dark mode, from the asset base, and Quiet has no default for it. Without one, every render fails at the logo: layout.html:28:102: error calling url: url "/logo.png": relative url not allowed. The kit's placeholder logos are in quiet.Files() under assets/. Host your own logos under those two names.
  • Set the brand vars. The header, footers and sign-off read the brand name, links and address from kit vars. They ship with neutral defaults (Quiet, https://example.com), so set them with Config.Vars. The vars table lists them.
  • Name profiles after the footers you want. The layout picks the footer from the profile's name, so a profile called buyer gets the service footer and one called promo the marketing footer. See Choose a footer with the profile.

quiet.USD(3400) prints US$34: whole amounts drop their decimals. Set Symbol for another prefix, as Loam does with quiet.Money{Minor: 3400, Currency: quiet.USDCode, Symbol: "$"}, or use quiet.Exact to always show two decimals.

Set the brand vars

Every var has a default in the kit's kit.yaml. Config.Vars overrides any of them per renderer. A key the kit doesn't declare is a NewRenderer error.

VarDefaultUsed in
brandQuietThe logo's alt text, "The {brand} team" in signoff, the footer address line and several footer sentences
sitehttps://example.comThe marketing footer's nav row (Shop, Sell, the journal)
domainexample.comThe newsletter footer: "You're getting {journal} because you subscribed on {domain}."
helphttps://example.com/help"Visit the Help Centre" in the service footer, and Help in the nav row
prefshttps://example.com/preferencesNotification settings and Preferences links
address1 Example StreetThe address line of every footer: "{brand} · {address}"
regionyour regionThe promo footer: "…subscribed to {brand} updates for {region}."
journalJournalThe newsletter masthead ("{journal} · No. {issue}") and the nav row
about.buyeryour order"This is a service email about …" for the buyer profile
about.selleryour seller accountThe same, for seller
about.driveryour driver accountThe same, for driver
asset_basenoneThe logos. Set it with Config.AssetBase, not Vars.

A Profile in lttr only says who a message is from and which headers it carries. Quiet's layout.html reads the profile's name (.Doc.Profile.Name) and picks the header and footer from it:

Profile nameFooterHeader
buyer, seller, driver, security and any other nameService: a note, "This is a service email about …" with Notification settings, then the addressLogo
announcementMarketing without the nav row. With frontmatter legal: true, the service footer insteadLogo
newsletter, promoMarketing: the nav row (Shop, Sell, the journal, Help), the reason with Unsubscribe and Preferences links, then the addressLogo
b2bOutreach: the address, then an opt-out lineLogo
internalInternal: "Internal. Do not forward outside {brand}.", then the addressThe "Internal · Do not forward" banner above the logo

Any template with frontmatter issue: also gets the newsletter masthead under the logo, "{journal} · No. {issue}".

The marketing footer links the recipient's UnsubscribeURL, so rendering a marketing template for a recipient without one fails: layout.html:79:38: error calling url: url "": empty. Set ListUnsubscribe: true on those profiles too, so the message carries the RFC 8058 one-click headers. See Profiles and config.

The default copy changes with the profile. Seller mail says "Questions? Reply to this email.", security mail says "{brand} will never ask for your password or this code by phone or chat." and has no service line, and everything else points to the Help Centre. A template changes the copy with the frontmatter keys Quiet declares:

KeyTypeReplaces
noteinline MarkdownThe first line of the service footer
abouttextWhat "This is a service email about …" names
reasoninline MarkdownThe marketing footer's "You're getting this because …" line
optoutinline MarkdownThe outreach footer's opt-out line
navflag, default truenav: false drops the marketing nav row
legalflagOn an announcement, switches to the service footer
issuetextAdds the masthead, "{journal} · No. {issue}"
examples/quiet/templates/02-grower-payout.md
---
template: payout.sent
profile: seller
subject: "Payout sent: {{amount}}"
preheader: "{{order_count}} orders, {{period}}. In your bank within 48 hours."
note: Questions about this payout? Reply to this email.
---

See Frontmatter for the core keys every kit has.

Browse the components

Quiet has 24 components. 22 of them stand at the top level, and two, story and product, only nest inside stories and products. Each keeps the short ID it had in lttr v0.1 as an alias, so ::k1 is ::statement. Names and aliases are case-insensitive.

Two limits apply across a template. It may have at most one :button (more than one :button in the template), and letter, where loose Markdown goes, takes :link but no :button (letter: :button is not allowed here).

Heroes

The opening block of most emails: centred, with the largest type.

ComponentForAttributes and contentExample
statement · k1The headline blockeyebrow; tone="orange" for an accent eyebrow; size="xl" for the large h1. At most one heading (h1–h3), then paragraphs, lists and one action row::statement{eyebrow="Order {{order_id}}"}
figure · k2A big amountamount (required), eyebrow, usd for a line under the amount. Paragraphs::figure{eyebrow="Weekly payout · {{period}}" amount="{{amount}}"}
offer · e3A discount codeeyebrow. Exactly a ## heading, whose code span is the code, then one small terms paragraph::offer{eyebrow="This week only"}

Bands

Full-width images with no side padding and no text form.

ComponentForAttributes and contentExample
image · k3A hero imagesrc, alt (required with src), height (default 340), tone (warm, sea, sun, map) for the ground shown without src. No content. Must directly follow a statement::image{src="{{hero_image}}" alt="Rows of young apple trees on a hillside" tone="warm"}
map · t4A static mapsrc, height (default 260), and alt or both pickup and dropoff (the alt is then "Map from {pickup} to {dropoff}"). No content::map{src="{{map_url |}}" pickup="{{pickup_area}}" dropoff="{{dropoff_area}}"}

Quiet doesn't fetch maps. Render the image with your map provider, host it, and pass its URL in your data. {{map_url |}}, with an empty fallback, lets the URL be empty, and the band then shows its map ground.

Tables

Rows of labels and values, 32 px above and below.

ComponentForAttributes and contentExample
receipt · t1An order summaryBinds order, a quiet.Receipt (required): lines with thumbnails, fees, the total and an optional ≈ US$ line. total_label overrides the label::receipt{:order="order"}
stock · t5Stock leftBinds items, a []quiet.StockItem (required): name and SKU against "N left", or "Out of stock" in red::stock{:items="stock"}
breakdown · b4A two-column money tableOne table of two columns. Its header row is a body row, and the last column is right-aligned::breakdown then | Sales · {{order_count}} orders | {{sales}} |
compare · b5Before and afterOne table of up to three columns, with a header row. With three, the middle column is small. **x** in a value cell is a bold teal value::compare then | Commission | Now | From 1 Nov |
tableAny small tableOne table of up to four columns, aligned as the Markdown says. headless makes the header row a body row::table then | Date | Where | Time |

Body copy

Left-aligned reading text.

ComponentForAttributes and contentExample
letter · b1Paragraphs of proseParagraphs, ### headings, lists and a row of :links. Loose Markdown between components goes here: it is the kit's defaultAny Markdown outside a component
meta · t3Details, two to a rowOne to four ### Label and paragraph pairs. A soft line break in a paragraph is a line break::meta then ### Deliver to
quote · e2A pull quotecite. One paragraph, in italic serif::quote{cite="Ruth Calloway · Hollow Oak Farm"}
notice · b2A bordered asidetitle; tone="warn" for the warning ground. One or two paragraphs::notice{title="Didn't ask for this?"}

Tails

Blocks that close off a hero: no padding above.

ComponentForAttributes and contentExample
progress · t2A step tracker2 to 5 steps, from steps (a comma-separated list) or the :steps binding (a []string), not both. current is a step name or a 1-based number, and may be a merge tag::progress{steps="Confirmed, Packed, On its way, Delivered" current="On its way"}
code · b3A one-time codevalue (required), shown large with its spaces removed. An optional expiry paragraph::code{value="{{otp_code}}"}
actions · c1 c2 c3A row of actions on its ownExactly one action row: a :button, a :button and a :link, or a :link::actions then :button[View payout]{href="{{payout_url}}"}

Tiles

Grids of two tiles to a row, for newsletters and campaigns. In the text part, each tile is a block of its own: the title or the name and price, then its link.

ComponentForAttributes and contentExample
stories · e1Story tilesOne to four :::story children, with a hairline between rows::stories
storyOne story tilehref (required), eyebrow, image, alt, cta (default Read), tone. One paragraph, the title. Only inside stories:::story{eyebrow="Grow" href="https://loam.example/notes/cold-frame" tone="sea"}
products · e4Product tilesBinds items, a []quiet.Product, or up to four :::product children, not both. cta (default Buy)::products{:items="products"}
productOne product tilename, price and href (required), image, alt, cta, tone. No content. Only inside products:::product{name="Heritage apples" price="$6" href="https://loam.example/p/apples"}

Sign-offs and rules

ComponentForAttributes and contentExample
signoff · s2The team sign-offclosing or one paragraph, not both ("Thanks," without either). name, default "The {brand} team"::signoff{closing="Thanks for growing with us,"}
signature · s1A personal sign-offname (required), role, contact::signature{name="Nadia Brennan" role="Restaurant Partnerships, Loam"}
dividerA hairline between blocksNo content and no text form::divider

Every component's schema is in kits/quiet/components/<name>/component.yaml. Component schemas explains the keys.

Know the spacing rules

Templates never set margins. Each component's spacing in its schema says how much padding it has above and below, and the engine resolves the whole stack in three passes:

  1. Each component starts with its own top and bottom.
  2. A component's after rules apply when it directly follows a named component or a component of a class (.hero, .band, .tabular). They can set its top and bottom and, with prev_bottom, the previous component's bottom.
  3. Position rules win: the first component's first edge, then the last component's last edge.

What that means in Quiet:

ComponentPadding (px)Rules
Heroes (statement, figure, offer)40 above, 36 below40 below when last
Bands (image, map), tiles, divider0Full bleed
receipt, stock, breakdown, compare, table32 above and below0 above after a figure or meta, and the figure gets 32 below. receipt and compare set a statement before them to 24 below, table to 16
letter32 above, 28 below36 above when first
meta0 above, 32 below32 above after a band
notice0 above, 32 below40 below when last or after a band
quote40 above and below
progress0 above, 8 belowSets a hero before it to 28 below
code0 above, 40 belowSets a hero before it to 0 below
actions0 above, 40 below8 above after any of the five tables
signoff, signature0 above, 36 below

The view hands the resolved values to the template as .Section.Top and .Section.Bottom. See Component schemas for the spacing keys.

Bind the Go types

Four components bind Go values. The kit registers these types, and a binding must have exactly its type:

TypeBound byHolds
quiet.Receiptreceipt :orderLines []ReceiptLine, Fees []Fee, Total Money, an optional TotalUSD *Money and TotalLabel
[]quiet.StockItemstock :itemsName, SKU and Left for each item
[]quiet.Productproducts :itemsName, Price Money, Href, Image and Tone for each tile
[]stringprogress :stepsThe step labels

quiet.Money is an amount in minor units with a currency, and prints through String(), so it works in merge tags too: Loam's {{amount}}, a quiet.Money with Symbol: "$", prints $1,019.90. quiet.Exact always shows two decimals, and Money.Approx() rounds to whole units with a ≈ prefix. See the API reference for every type and method.

See the nine Loam emails

examples/quiet is the package to copy from: profiles.go has the nine profiles, config.go the vars and Config, templates/ the nine templates and samples.go a typed data type and sample for each.

#TemplateProfileComponents
01order.out_for_deliverybuyerstatement, progress, receipt, meta
02payout.sentsellerfigure, breakdown, actions, signoff
03auth.resetsecuritystatement, code, notice
04notes.digestnewsletterstatement, image, stories, divider, quote
05campaign.harvest_weekpromostatement, image, products, divider, offer
06job.offereddriverstatement, map, meta, breakdown
07fees.changeannouncementstatement, compare, divider, letter, signoff
08outreach.partnerb2bletter, signature
09internal.ops_updateinternalstatement, table, notice, signoff

Each preview below is the real render. Switch it between 600 and 375 px, light and dark, or show the text part and the template source.

01 · A buyer's order on its way. The service footer, with the frontmatter note in place of the default.

Your produce box is on its way

From: Loam <orders@loam.example>

Profile: buyer
600 px · desktop
375 px · mobile

02 · A grower's payout. A figure hero, then a breakdown straight under it.

Payout sent: $1,019.90

From: Loam Growers <growers@loam.example>

Profile: seller
600 px · desktop
375 px · mobile

03 · A password reset. The security profile has no service line.

Your Loam reset code

From: Loam Security <security@loam.example>

Profile: security
600 px · desktop
375 px · mobile

04 · The Field Notes newsletter. Frontmatter issue adds the masthead, and the marketing footer has the nav row.

Forty trees after the frost

From: Field Notes <notes@loam.example>

Profile: newsletter
600 px · desktop
375 px · mobile

05 · A campaign. Products bound from data, and an offer code.

Harvest Week: 48 hours of the valley's best

From: Loam <hello@loam.example>

Profile: promo
600 px · desktop
375 px · mobile

06 · A courier's job offer. The map band renders its ground when map_url is empty.

New job: Millbrook to Fernhill · $6

From: Loam Couriers <couriers@loam.example>

Profile: driver
600 px · desktop
375 px · mobile

07 · A fee change. An announcement: the marketing footer without the nav row, and a reason from the frontmatter.

Lower commission on farm workshops from 1 November

From: Loam <hello@loam.example>

Profile: announcement
600 px · desktop
375 px · mobile

08 · Partner outreach. The b2b profile has no fixed sender, so the template sets from: on the partners subdomain. The outreach footer ends with the opt-out line.

Seasonal produce for Hearth

From: Nadia Brennan <nadia@partners.loam.example>

Profile: b2b
600 px · desktop
375 px · mobile

09 · An internal update. The internal profile adds the banner and the internal footer.

Q4 courier onboarding schedule

From: Loam Ops <team@loam.example>

Profile: internal
600 px · desktop
375 px · mobile

Restyle it

Quiet's vars are yours to set, but its tokens are fixed: Config has no way to override a colour or a font. To change them, take a copy. The kits/quiet package imports only the standard library and lttr/kit, so copy the whole directory, Go files included, into your module, rename the package and edit kit.yaml. Its template functions are unexported, so a copy of the kit files alone, without the Go package, doesn't load.

For a design of your own, start from Plain instead: Build your own kit walks through it.

Copyright © 2026