How to Create a Custom Input Component for an Array of Objects
FormBuilderInputcomponent - unfortunately this is not currently documented.
https://github.com/sanity-io/sanity/blob/a768eaf2611b4124e0ed6525bc82b0aa7e0ce00b/examples/example-studio/components/CustomObjectInput.js
https://github.com/sanity-io/sanity/blob/a768eaf2611b4124e0ed6525bc82b0aa7e0ce00b/[…]les/test-studio/src/components/CustomInputWithDialogOverlay.tsx
https://github.com/sanity-io/sanity/blob/a768eaf2611b4124e0ed6525bc82b0aa7e0ce00b/[…]/inputs/PortableText/Objects/renderers/PopoverObjectEditing.tsx
Also, the
ArrayInputhappens to be exported as a part you can use.
https://github.com/sanity-io/sanity/pull/2377#issuecomment-830131784
In any case, it appears to be largely uncharted territory for now.
{
title: "Event Timeline",
name: "event_timeline",
type: "array",
options: { editModal: "fullscreen", layout: "tags" },
of: [{ type: "audio_event_simple" }, { type: "video_event_simple" }],
},Was this answer helpful?
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.