Sanity Library Reference Docs
    Preparing search index...

    Interface ImageDefinition

    interface ImageDefinition {
        components?: ImageComponents;
        deprecated?: DeprecatedProperty;
        description?: string | Element;
        fields?: FieldDefinition<
            | "string"
            | "number"
            | "boolean"
            | "object"
            | "text"
            | "crossDatasetReference"
            | "reference"
            | "image"
            | "document"
            | "url"
            | "email"
            | "date"
            | "block"
            | "array"
            | "datetime"
            | "file"
            | "geopoint"
            | "globalDocumentReference"
            | "slug"
            | "sanity.video",
            undefined,
        >[];
        fieldsets?: FieldsetDefinition[];
        hidden?: ConditionalProperty;
        icon?: ReactNode
        | ComponentType;
        initialValue?: InitialValueProperty<any, ImageValue>;
        name: string;
        options?: ImageOptions;
        preview?: PreviewConfig;
        readOnly?: ConditionalProperty;
        renderMembers?: ObjectRenderMembersCallback;
        title?: string;
        type: "image";
        validation?: ValidationBuilder<ImageRule, ImageValue>;
    }

    Hierarchy

    • Omit<ObjectDefinition, "type" | "fields" | "options" | "groups" | "validation">
      • ImageDefinition
    Index

    Properties

    components?: ImageComponents
    deprecated?: DeprecatedProperty
    description?: string | Element
    fields?: FieldDefinition<
        | "string"
        | "number"
        | "boolean"
        | "object"
        | "text"
        | "crossDatasetReference"
        | "reference"
        | "image"
        | "document"
        | "url"
        | "email"
        | "date"
        | "block"
        | "array"
        | "datetime"
        | "file"
        | "geopoint"
        | "globalDocumentReference"
        | "slug"
        | "sanity.video",
        undefined,
    >[]
    fieldsets?: FieldsetDefinition[]
    icon?: ReactNode | ComponentType
    initialValue?: InitialValueProperty<any, ImageValue>
    name: string
    options?: ImageOptions
    preview?: PreviewConfig

    Callback that allows developers to customize the members of the object input. It can be used to add decoration members to the object input, instead of using empty fields. For example:

    import { Decoration } from './Decoration'

    renderMembers: (members) => {
    return [
    ...members,
    {
    key: 'decoration',
    kind: 'decoration',
    component: Decoration,
    },
    ]
    title?: string
    type: "image"