Skip to content

Letterhead

A branded letterhead and cover letter using an object param to group the sender’s contact details.

/*javasculpt-params
# Standalone parametric letterhead — fields arrive as sys.inputs.<name>
# (all strings). A #639 `object` param groups the sender's contact block into
# one control with scalar fields (one level of nesting is the maximum).
- name: sender
type: object
caption: Sender
fields:
- name: name
type: text
caption: Business name
- name: tagline
type: text
caption: Tagline
- name: address
type: text
caption: Address
- name: contact
type: text
caption: Email / phone
- name: recipient
type: text
caption: Addressed to
default: "Ms Harper Lind"
- name: dated
type: date
caption: Date
default: "2026-07-01"
- name: subject
type: text
caption: Subject line
default: "Your spring wedding flowers"
- name: body
type: text
widget: textarea
caption: Letter body
default: "Thank you for choosing us for your spring wedding. This letter confirms that we have reserved the dates we discussed and begun sourcing the seasonal blooms for your arrangements. A detailed quote will follow under separate cover."
- name: accent
type: color
caption: Accent colour
default: "#6b4e71"
*/
// ── Example: branded letterhead ────────────────────────────────────────────
// An `object` frontmatter param (`sender`) groups related scalar fields; read
// its members with .at(field, default: ...) since the whole object is optional.
// Business identity is fictional (Fabrikam Florals / .example).
#let accent = rgb(sys.inputs.at("accent", default: "#6b4e71"))
#let sender = sys.inputs.at("sender", default: (:))
#let sender-field(key, fallback) = {
let v = sender.at(key, default: fallback)
if v == none or v == "" { fallback } else { v }
}
#set page(paper: "a4", margin: (x: 24mm, top: 22mm, bottom: 24mm))
#set text(size: 11pt, fill: luma(30))
#set par(justify: true, leading: 0.7em)
// ── Masthead ───────────────────────────────────────────────────────────────
#block[
#text(size: 22pt, weight: "bold", fill: accent)[#sender-field("name", "Fabrikam Florals")]
#linebreak()
#text(size: 10pt, fill: luma(110), style: "italic")[#sender-field("tagline", "Seasonal arrangements, grown with care")]
]
#v(0.4em)
#line(length: 100%, stroke: 1.5pt + accent)
#v(0.2em)
#text(size: 8.5pt, fill: luma(120))[
#sender-field("address", "42 Blossom Lane, Blackheath NSW 2785")
#h(1em) · #h(1em)
#sender-field("contact", "[email protected]")
]
#v(2.4em)
// ── Date + recipient ─────────────────────────────────────────────────────────
#text(fill: luma(110))[#sys.inputs.dated]
#v(1.2em)
#sys.inputs.recipient
#v(1.4em)
#text(weight: "bold")[Re: #sys.inputs.subject]
#v(1em)
Dear #sys.inputs.recipient,
#v(0.4em)
#sys.inputs.body
#v(1.4em)
With warm regards,
#v(2.2em)
#text(weight: "bold")[#sender-field("name", "Fabrikam Florals")]