Skip to content

Documentation

Widget Architecture

Technical deep-dive into the SveltyCMS 3-Pillar widget system.

7/13/2026
1 min read Edit on GitHub
On this page

SveltyCMS widgets are built on a strict 3-Pillar pattern — a Valibot-validated definition (index.ts), an input component (Input.svelte), and a display component (Display.svelte) — composed via createWidget() from the widget factory.

Guides

Core Pattern

import { createWidget } from "@widgets/widgetFactory";
import * as v from "valibot";

export default createWidget<{ maxLength?: number }>({
  Name: "myWidget",
  validationSchema: (field) => v.string([v.maxLength(field.maxLength ?? 100)]),
  GuiSchema: { maxLength: { widget: "number", label: "Max Length" } },
});
widgetsarchitecturecore
Was this page helpful?