✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

Form API

The form API lets you customize the rendering of form components and specify options for asset sources in your studio.

  • componentsobject

    Accepts custom component overrides for the following form components: input, field, preview, and item. The components can be declared in the root studio configuration, in plugins, or directly in a schema definition.

    Form components API ->

  • fileobject

    Accepts an object with the following properties: assetSources and directUploads.

    assetSources accepts an array of valid asset source configuration objects, or a callback function resolving to the same. The callback function is called with the current list of registered asset sources as its first argument and a context object as the second.

    directUploads accepts a boolean true or false.

  • imageobject

    Accepts an object with the following properties: assetSources and directUploads.

    assetSources accepts an array of valid asset source configuration objects, or a callback function resolving to the same. The callback function is called with the current list of registered asset sources as its first argument and a context object as the second.

    directUploads accepts a boolean true or false.

Was this article helpful?