Custom Field Types
A custom field type allows you to create reusable, complex input controls and previews available in the CMS interface. Registered field types can be used in your collection just like built-in field types.
Unimplemented
This feature is not yet supported in Sveltia CMS. It will be added soon.
Note for Netlify/Decap CMS Users
In Sveltia CMS, what was previously referred to as a widget in Netlify/Decap CMS is now called a field type. This change was made to better align with common content management terminology, as originally proposed by Netlify CMS maintainers themselves.
The registerWidget method from Netlify/Decap CMS has been renamed to registerFieldType in Sveltia CMS to reflect this terminology change, but the old name remains available as an alias for backward compatibility. The signature and behavior are identical.
Overview
To register a custom field type, use the registerFieldType method on the CMS object:
CMS.registerFieldType(name, control, [preview], [schema]);For backward compatibility with Netlify/Decap CMS, the registerWidget method is available as an alias with the same signature.
Parameters
name(string, required): The name of the custom field type. This is the name you will use in your collection configuration to reference this type. It should be unique and not conflict with built-in field types names.control(React component, required): A React class component that defines the control (input) part of the field.preview(React component, optional): A React class component that defines how the field’s value is previewed in the CMS preview pane. If not provided, no preview will be shown.schema(object, optional): A JSON schema object that defines the configuration options for the field type.