Sanity Library Reference Docs
    Preparing search index...

    Interface FileDefinition

    interface FileDefinition {
        components?: FileComponents;
        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, FileValue>;
        name: string;
        options?: FileOptions;
        preview?: PreviewConfig;
        readOnly?: ConditionalProperty;
        renderMembers?: ObjectRenderMembersCallback;
        title?: string;
        type: "file";
        validation?: ValidationBuilder<FileRule, FileValue>;
    }

    Hierarchy

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

    Properties

    components?: FileComponents
    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, FileValue>
    name: string
    options?: FileOptions
    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: "file"