Widget reference

Every element in the Insert panel, generated from the same registry the editor and renderer use. 0 widgets in total.

Adding a widget (for contributors)

import { defineWidget, p } from "../registry";

defineWidget({
  type: "hello",
  label: "Hello",
  category: "utility",
  description: "Says hello.",
  icon: "Smile",
  defaults: () => ({ geometry: { w: 200, h: 40 }, props: { who: "world" } }),
  fields: [{ key: "who", label: "Who", kind: "text" }],
  render: ({ props }) => <span>Hello, {p.str(props, "who")}</span>,
});

The editor builds its inspector form from fields; nothing else needs to change.