Text, number, date and time
The plain values: a line of text, a number, a date, a date with a time, and the slug that becomes part of an entry's URL.
Text
f.text() is a single line. .max(n) limits it in characters, and publish enforces the limit. There is no multi-line text field: paragraphs are richtext, which keeps formatting as data rather than as line breaks.
fields: {
heading: f.text().max(80),
text: f.text().max(200).optional(),
label: f.text().max(40),
href: f.link(),
},Text is the one field editors can change in place in the canvas, when its element carries a mark.
Number
f.number() shows a number box and stores a number. An empty box stores nothing, so an optional number is undefined in the view, not 0.
Date and time
f.date() is a calendar: a text box the editor may type into, and a calendar button that opens a month grid. It stores the day as 2026-09-02, and publish refuses anything else — 2.9.2026 or a February 30th never reach the site. The view formats it for the reader; the starter formats in the page's language:
export const formatDate = (iso: string, locale: string) =>
new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeZone: "UTC" }).format(new Date(iso));f.datetime() is the same calendar with an hour and a minute beside it. It stores a moment in time as a UTC instant, 2026-09-02T14:30:00Z, so an event start or a publish-at means the same thing in every zone and sorts as a string. The editor picks in the site's time zone, and a hint under the field names it.
The site's zone is one line of config, an IANA name:
export const config = defineConfig({
// …
locales: { default: routing.defaultLocale, supported: [...routing.locales] },
// Editors pick dates and times in this zone; the views format with it (an IANA name, never an offset).
timeZone: "Europe/Helsinki",
// …
});Name a city, never an offset. "+3" is wrong half the year; Europe/Helsinki carries the daylight-saving rules, and the browser and Node apply them from their own zone database. defineConfig refuses a name the runtime does not know. Without timeZone, editors pick in their own browser's zone, and the hint says so.
A view formats a datetime with the same zone:
export const formatDateTime = (iso: string, locale: string, timeZone: string) =>
new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short", timeZone }).format(new Date(iso));Pass config.timeZone from your config file. A collection can order its entries by either field, as the starter's articles do with order: { by: "date", direction: "desc" }.
Time zones in Europe
The value to put in timeZone, country by country. A country with several zones has its capital first.
AlbaniaEurope/TiraneAndorraEurope/AndorraAustriaEurope/ViennaBelarusEurope/MinskBelgiumEurope/BrusselsBosnia and HerzegovinaEurope/SarajevoBulgariaEurope/SofiaCroatiaEurope/ZagrebCyprusAsia/NicosiaCzechiaEurope/PragueDenmarkEurope/CopenhagenEstoniaEurope/TallinnFaroe IslandsAtlantic/FaroeFinlandEurope/HelsinkiÅlandEurope/MariehamnFranceEurope/ParisGermanyEurope/Berlin (Büsingen: Europe/Busingen)GibraltarEurope/GibraltarGreeceEurope/AthensGuernseyEurope/GuernseyHungaryEurope/BudapestIcelandAtlantic/ReykjavikIrelandEurope/DublinIsle of ManEurope/Isle_of_ManItalyEurope/RomeJerseyEurope/JerseyKosovoEurope/BelgradeLatviaEurope/RigaLiechtensteinEurope/VaduzLithuaniaEurope/VilniusLuxembourgEurope/LuxembourgMaltaEurope/MaltaMoldovaEurope/ChisinauMonacoEurope/MonacoMontenegroEurope/PodgoricaNetherlandsEurope/AmsterdamNorth MacedoniaEurope/SkopjeNorwayEurope/Oslo (Svalbard: Arctic/Longyearbyen)PolandEurope/WarsawPortugalEurope/Lisbon (Azores: Atlantic/Azores, Madeira: Atlantic/Madeira)RomaniaEurope/BucharestRussiaEurope/Moscow (also Europe/Kaliningrad, Europe/Samara, Europe/Astrakhan, Europe/Saratov, Europe/Ulyanovsk, Europe/Volgograd, Europe/Kirov)San MarinoEurope/San_MarinoSerbiaEurope/BelgradeSlovakiaEurope/BratislavaSloveniaEurope/LjubljanaSpainEurope/Madrid (Canary Islands: Atlantic/Canary)SwedenEurope/StockholmSwitzerlandEurope/ZurichTurkeyEurope/IstanbulUkraineEurope/Kyiv (Crimea: Europe/Simferopol)United KingdomEurope/LondonVatican CityEurope/VaticanOutside Europe the same rule holds — a city name from the IANA database, such as America/New_York or Asia/Tokyo. The full list is Intl.supportedValuesOf("timeZone") in any modern runtime.
Slug
f.slug() is a text box shown with the entry's URL prefix in front, such as /posts/. It belongs on a collection, and the field must be named slug: that is the name the URL is built from, so collection() refuses f.slug() under any other name.
export const articles = smoodly.collection({
name: "articles",
title: "Articles",
titleField: "title",
path: { en: "posts", fi: "artikkelit" },
// …
fields: {
title: f.text().localized(),
// …
slug: f.slug({ from: "title" }),
// …
},
});The starter passes from: "title": the admin fills the slug from the title as the editor types it, until they type a slug of their own. It stops at the first publish, so a live URL never changes by itself. A slug is tidied when the box loses focus, so Hello World becomes hello-world, and publish refuses anything that is still not a valid slug. A slug is per language without .localized(), because each language has its own URL. Two entries under the same parent cannot share one. Pages have no slug field: a page's slug is set in the admin when it is created and renamed under Settings.
Next, Richtext and elements.