/sanity:sanity-form-component-suspensefrom sanity
Fixes Sanity Studio custom form components that suspend without a Suspense boundary, preventing layout shift and blocking new documents. Wraps suspending parts (React.lazy, use(), App SDK hooks) in a boundary with a space-reserving fallback.
Ships in sanity. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Studio puts a fallback boundary around every field and every array item, so one suspending
component cannot blank the form. That fallback is a generic skeleton: it does not know the size of
what it replaces, so the form shifts when the component loads, and Studio warns about it in the
console. The fix always lives in your code: declare a Suspense around the part that suspends,
with a fallback that takes the same space as what it stands in for. Any boundary you declare is
closer to what suspends than Studio's, so it always wins and nothing warns. That includes a
boundary in a custom field around props.renderDefault(props), which also covers the field's
input: use it when one fallback should cover both, for example a lazy input that also fetches.
components.field, .input or .item), the path, the document type and the schema type,
and logs the components themselves; click one in the browser console to open its source.
Production builds minify the names, so use the path and document type there. When the schema
type declares none, the warning starts with "A form component" and the culprit is usually a
plugin's form.components. React DevTools' Suspense tab shows which component actually
suspended.React.lazy, use(promise), an App SDK hook
(useDocumentProjection, useDocument, useQuery, useDocuments), or a library in suspense
mode (useSuspenseQuery).<Suspense> inside the custom component. Keep props.renderDefault(props) outside the
boundary, so the built-in input, field or item never unmounts (and never loses focus while
someone types) when the async part suspends again.renderDefault so it never pushes
the rest down, and give the fallback the height of one loaded row.null.useFormValue(['_createdAt']): it is unset until the document exists.useState or in useMemo is
thrown away while the component suspends on mount, so use() gets a new one every retry and
never settles. Use the SDK hooks, a module-scope cache keyed by the inputs, or a data library.import {createDocumentHandle, useDocumentProjection} from '@sanity/sdk-react'
import {Card, Skeleton, Stack, Text} from '@sanity/ui'
import {Suspense} from 'react'
import {type ArrayOfObjectsInputProps, getPublishedId, useFormValue} from 'sanity'
export function ModelSizeInput(props: ArrayOfObjectsInputProps) {
const documentId = useFormValue(['_id']) as string
const documentExists = Boolean(useFormValue(['_createdAt']))
const hasModels = (props.value?.length ?? 0) > 0
return (
<Stack gap={3}>
{props.renderDefault(props)}
{documentExists && hasModels ? (
<Suspense fallback={<Skeleton radius={2} style={{height: 33}} animated />}>
<ModelSizeWarnings documentId={getPublishedId(documentId)} />
</Suspense>
) : null}
</Stack>
)
}
function ModelSizeWarnings(props: {documentId: string}) {
const {data} = useDocumentProjection<{missing: number}>({
...createDocumentHandle({documentType: 'product', documentId: props.documentId}),
projection: `{"missing": count(models[!defined(@->size)])}`,
})
return (
<Card padding={2} radius={2} tone={data.missing > 0 ? 'critical' : 'positive'}>
<Text size={1}>{data.missing} models are missing a size</Text>
</Card>
)
}
The skeleton's height matches the one-line card it stands in for. If the loaded UI's height varies, reserve the most common case and keep the variable part below the input.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
11 skills in this plugin
/content-experimentation-best-practicesContent experimentation and A/B testing guidance covering experiment design, hypotheses, metrics, sample size, statistical foundations, CMS-managed variants, and common analysis pitfalls. Use this skill when planning experiments, setting up variants, choosing success metrics, interpreting statistical results, or building experimentation workflows in a CMS or frontend stack./content-modeling-best-practicesStructured content modeling guidance for schema design, content architecture, content reuse, references versus embedded objects, separation of concerns, and taxonomies across Sanity and other headless CMSes. Use this skill when designing or refactoring content types, deciding field shapes, debating reusable versus nested content, planning omnichannel content models, or reviewing whether a schema is too page-shaped or presentation-driven./portable-text-conversionConvert HTML and Markdown content into Portable Text blocks for Sanity. Use when migrating content from legacy CMSs, importing HTML or Markdown into Sanity, building content pipelines that ingest external content, converting rich text between formats, or programmatically creating Portable Text documents. Covers @portabletext/markdown (markdownToPortableText), @portabletext/block-tools (htmlToBlocks), custom deserializers, and the Portable Text specification for manual block construction.npx claudepluginhub sanity-io/agent-toolkit --plugin sanityOther plugins' skills for the same job