Skip to content
HomePagesHomePages template kit
Menu

A select slot — a closed set of choices

Give the user a closed set of choices — an editable content slot, distinct from a behavioral enum option.

Give the user a closed set of choices — an editable content slot, distinct from a behavioral enum option.

A select slot still needs a source or a produced_by, exactly like every other slot type — values alone only declares the closed set the editor’s dropdown offers. The cleanest no-AI fill for a closed set is usually a direct() fact that already resolves to one of a closed set of strings:

// schema.ts — add a select slot, seeded from a closed-vocabulary fact
property_type: {
type: "select",
editable_by_user: true,
required: false,
values: ["single_family", "condo_townhome", "multi_family", "investment"],
source: direct("property_type"),
display_name: "Property type",
},
// Renderer.tsx — read it like any other text-shaped slot
<Slot id="property_type" textLeaf>
<span>{slots.property_type}</span>
</Slot>

slots.property_type is string | null (required is false). The general source/produced_by contract still applies to a select slot, but no fill-spec decision type constrains its output to the closed values set — so source: direct(...) (a fact that already resolves within the set) is the reliable way to fill one.

None — this is a pure content edit. No CLI command beyond the author loop below.

Verify with the author loop.

  • The closed vocabulary — the slot-type table, including where select sits next to text/number/etc.
  • The schema system — the full schema.ts contract, including direct()/derived() binding.