Skip to content

Templates Overview

Glyph templates are pre-designed document layouts that you populate with your data. Each template includes HTML structure, CSS styling, and a data schema.

Glyph ships with 16 production-ready templates across 11 document categories:

TemplateDescriptionBest For
quote-modernClean, minimal design with generous whitespaceSaaS, tech companies, agencies
quote-professionalTraditional business style with formal typographyLaw firms, consulting, B2B
quote-boldHigh-impact design with dark headerCreative agencies, startups
invoice-cleanClear, structured invoice layoutFreelancers, small businesses
receipt-minimalCompact receipt formatE-commerce, retail, POS
report-coverProfessional report cover pageConsulting, research, analytics
contract-simpleClean contract layout with signature blocksLegal, agreements, SOWs
certificate-modernAward-style certificate with modern stylingTraining, education, events
letter-businessFormal business letter formatCorrespondence, notices
proposal-basicStructured proposal layoutSales, project proposals
shipping-labelCompact shipping label with address blocksFulfillment, logistics
packing-slipOrder contents summary with item listE-commerce, warehouses
resumeProfessional CV layoutJob applications, HR
menuRestaurant/service menu layoutFood service, hospitality
event-ticketEvent admission ticket with QR code supportEvents, ticketing
purchase-orderFormal purchase order documentProcurement, supply chain

Each template consists of:

templates/
quote-modern/
template.html # HTML structure with Mustache placeholders
styles.css # Template-specific styles
schema.json # Data validation schema

Templates use Mustache syntax for data binding:

<h1>{{branding.companyName}}</h1>
<p>Prepared for: {{client.name}}</p>
{{#lineItems}}
<tr>
<td>{{description}}</td>
<td>{{quantity}}</td>
<td>${{unitPrice}}</td>
<td>${{total}}</td>
</tr>
{{/lineItems}}

Templates define clickable regions using data-glyph-region attributes:

<header data-glyph-region="header">
<!-- Logo and company info -->
</header>
<section data-glyph-region="client-info">
<!-- Client details -->
</section>
<table data-glyph-region="line-items">
<!-- Products/services -->
</table>

Users can click these regions to target AI modifications.

All quote templates include these regions:

RegionDescriptionTypical Content
headerDocument headerLogo, company name, document title
metaDocument metadataQuote number, date, valid until
client-infoRecipient infoName, company, email, address
line-itemsItems tableProducts, services, quantities, prices
totalsCalculationsSubtotal, tax, discount, total
notesAdditional infoSpecial instructions, comments
footerDocument footerTerms, conditions, signatures

Each template defines expected data using JSON Schema:

{
"required": ["client", "lineItems", "totals"],
"properties": {
"client": {
"type": "object",
"required": ["name"],
"properties": {
"name": { "type": "string" },
"company": { "type": "string" },
"email": { "type": "string", "format": "email" }
}
}
}
}

Pass the template ID to the editor or API:

<glyph-editor template="quote-professional" ...></glyph-editor>
const { html, sessionId } = await api.preview('quote-bold', data);

Templates can be customized in several ways:

Some templates accept style customization via data:

{
"styles": {
"accentColor": "#7c3aed",
"fontFamily": "Georgia, serif"
}
}

Use natural language to modify any aspect:

await editor.modify("Change the accent color to purple");
await editor.modify("Use a more formal serif font");
await editor.modify("Make the header smaller");

Create your own templates for complete control. See Custom Templates.

Get available templates via the API:

const response = await fetch('https://api.glyph.you/v1/preview/templates', {
headers: { 'Authorization': 'Bearer gk_your_key' }
});
const { templates } = await response.json();
// [{ id: 'quote-modern', name: 'Modern Quote', ... }, ...]

Templates are organized by document type:

CategoryTemplatesStatus
Quotequote-modern, quote-professional, quote-boldAvailable
Invoiceinvoice-cleanAvailable
Receiptreceipt-minimalAvailable
Reportreport-coverAvailable
Contractcontract-simpleAvailable
Certificatecertificate-modernAvailable
Letterletter-businessAvailable
Proposalproposal-basicAvailable
Shippingshipping-label, packing-slipAvailable
ResumeresumeAvailable
MenumenuAvailable
Ticketevent-ticketAvailable
Purchase Orderpurchase-orderAvailable