In short.
Sanity Form Component Suspense is an assistant skill for developers repairing asynchronous Sanity Studio form components, with the catch that its examples need adaptation to the component’s layout and data. It covers missing Suspense boundaries, loading placeholders, editor focus, reads of new documents and promises that restart during rendering. The supplied material includes a worked example, but no executed tests, compatibility results or measured layout improvements.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes skills/sanity-form-component-suspense/SKILL.md, the only selected file in the supplied folder manifest, and the repository-root LICENSE at commit 3ed3a143f8d3413faa7790ac0b2274fd3a8a6320. Other repository skills, application code, external documentation and dependency implementations are outside this scope. No code was executed; runtime behavior, compatibility, costs and measured improvements are unverified.
The overview
Identity
The skill is named sanity-form-component-suspense and lives in sanity-io/agent-toolkit under skills/sanity-form-component-suspense/SKILL.md. It supplies instructions an assistant can use when helping repair Sanity Studio custom inputs, fields, array items or plugin form components.
The captured source is available at [https://raw.githubusercontent.com/sanity-io/agent-toolkit/3ed3a143f8d3413faa7790ac0b2274fd3a8a6320/skills/sanity-form-component-suspense/SKILL.md].
Assessment
This is a focused resource for a recognizable problem: a custom form component waits for code or data, Studio displays a generic skeleton, and the form shifts or a loading state persists. The instructions connect these symptoms to specific changes in component structure, fallback dimensions and document reads.
Its practical value is the repair explanation and example. Successful repairs, compatibility and performance improvements have not been assessed through execution.
Users
The intended users are developers maintaining Sanity Studio schemas, custom form components or plugins. A relevant starting symptom is a console warning that a custom input, field or item suspended without its own Suspense boundary.
Beginners need some familiarity with React components and Sanity schema configuration. Experienced developers get more specific guidance for React.lazy, use(promise), App SDK hooks, suspense-enabled data libraries and virtualized array rows.
Capabilities
The skill explains how to locate the responsible component using the console warning’s component names, field path, document type and schema type. It also suggests React DevTools’ Suspense tab when the component actually waiting for data is unclear.
Its repair guidance covers isolating asynchronous UI, providing a loading placeholder with matching dimensions, retaining the built-in editor, gating document reads until a document exists, and avoiding promises that are recreated on every retry.
Using it
Requirements
Applying the guidance requires access to the affected Studio component and its schema or plugin configuration. Diagnosis uses the browser console; React DevTools is an additional suggested aid.
The example imports React, sanity, @sanity/sdk-react and @sanity/ui. It assumes a product document with a models array whose referenced documents may have a size field. Package versions, minimum Studio version, assistant compatibility and hardware requirements are unspecified.
Mechanism
React Suspense displays a fallback while a child waits for code or data. The skill explains that Studio already supplies generic boundaries around fields and array items; a boundary inside the custom component can handle the wait closer to its source and use a placeholder sized for that particular UI.
For an added warning or preview, the suggested structure keeps props.renderDefault(props) outside the boundary and places the asynchronous child after it. The skill also gates current-document reads with useFormValue(['_createdAt']) and recommends stable data sources or cached promises to avoid repeated suspension during mounting.
Setup
Start with the component identified by the warning and locate the operation that suspends. Move that operation into a child component where needed, then place an appropriate Suspense boundary around it.
Choose a fallback that occupies the loaded component’s space. Add the document-existence guard when reading the current document, and check how promises are retained. The supplied file does not specify an assistant installation command or dependency installation procedure.
Example
ModelSizeInput preserves Sanity’s default array editor and adds a warning card below it. The card appears only when _createdAt is present and the array contains models. While its data loads, a Suspense boundary displays an animated skeleton with a height of 33 pixels.
The child component uses useDocumentProjection and createDocumentHandle to count model references missing a size. It displays that count with critical or positive styling. The document type, field names, projection and placeholder height require adaptation to another project; the example was not executed.
Assessment & evidence
Limitations
The instructions target suspension in custom Studio form components. They do not establish a remedy for every loading failure, query error or form performance problem.
The 33-pixel placeholder is specific to the example’s one-line card. Variable-height content and virtualized array items need their own sizing decisions. No test suite, compatibility matrix or measured results are included, so warning removal, focus preservation and layout stability remain unverified.
Design rationale
The guidance addresses three separate causes of poor form behavior: a generic fallback cannot reserve the right space, an overly broad boundary can interrupt the built-in editor, and a current-document query can wait indefinitely before the document exists.
Keeping added asynchronous UI separate is intended to preserve editing continuity. Matching fallback dimensions is intended to reduce movement when content arrives. Stable promises address repeated retries during initial mounting. These are the source’s explanations, without accompanying execution evidence.
Implementation choices
For an added warning or count, the source recommends a boundary around only that addition. For a whole component loaded lazily, it recommends a skeleton matching the component’s height. It also describes a custom field boundary around props.renderDefault(props) when one fallback should cover both the field and its input.
For stable asynchronous reads, the suggested options are SDK hooks, a module-scope cache keyed by inputs, or a data library. The source does not compare competing skills or establish which option best fits a particular project.
Evidence
The supplied resource consists of the complete SKILL.md instructions and its React/TypeScript example, accompanied by the repository-root MIT licence. These support the description of its intended behavior, implementation guidance and reuse rights.
No application source, dependency lockfile, runtime logs or executed test results accompany the skill. Its claims about Studio behavior and repair outcomes have not been independently verified.
Access & freshness
Costs
No purchase price, subscription, usage quota or operating-cost estimate is provided. Costs for an assistant, Sanity services, hosting and data queries are unknown from the supplied evidence.
The MIT licence grants software reuse rights, but does not establish the cost of the surrounding development or service environment.
Rights
The repository-root LICENSE identifies Sanity as the 2025 copyright holder and uses the MIT License. It permits use, modification, distribution, sublicensing and sale, subject to retaining the copyright and permission notices in copies or substantial portions.
The software is supplied without warranty. The licence text is at [https://raw.githubusercontent.com/sanity-io/agent-toolkit/3ed3a143f8d3413faa7790ac0b2274fd3a8a6320/LICENSE]. Terms for external services and dependencies are not supplied.
Freshness
The supplied snapshot was captured on 16 November 2026 at repository commit 3ed3a143f8d3413faa7790ac0b2274fd3a8a6320. That commit identifies the exact source described here.
The skill does not state a release date, last-update date or supported package versions. Compatibility with a particular Studio, React or App SDK release is unknown.
Next steps
Use the warning’s field path and document type to find the affected component, then choose a boundary placement that matches whether the asynchronous UI supplements or replaces the editor. Adapt the data query and fallback dimensions to the actual schema and layout.
After making changes, follow the source’s suggested checks on both new and existing documents: confirm that the warning disappears, editing is immediately available and content does not jump when loading finishes. Also check focus during later suspension and row movement for array items. These checks remain to be performed.
