Sanity Library Reference Docs
    Preparing search index...

    Interface ArrayOptions<V>

    BaseOptions applies to all type options.

    It can be extended by interface declaration merging in plugins to provide generic options to all types and fields.

    interface ArrayOptions<V = unknown> {
        canvasApp?: CanvasAppOptions;
        direction?: "horizontal" | "vertical";
        disableActions?: ArrayActionName[];
        insertMenu?: InsertMenuOptions;
        layout?: "list" | "grid" | "tags";
        list?: TitledListValue<V>[] | V[];
        modal?: { type?: "popover" | "dialog"; width?: number | "auto" };
        sanityCreate?: SanityCreateOptions;
        search?: { weight?: number };
        sortable?: boolean;
        treeEditing?: boolean;
    }

    Type Parameters

    • V = unknown

    Hierarchy (View Summary)

    Index

    Properties

    canvasApp?: CanvasAppOptions
    direction?: "horizontal" | "vertical"

    This option does not have any effect anymore

    disableActions?: ArrayActionName[]

    A list of array actions to disable Possible options are defined by ArrayActionName

    insertMenu?: InsertMenuOptions

    This API may change

    layout?: "list" | "grid" | "tags"
    list?: TitledListValue<V>[] | V[]
    modal?: { type?: "popover" | "dialog"; width?: number | "auto" }
    sanityCreate?: SanityCreateOptions
    search?: { weight?: number }

    Type declaration

    • Optionalweight?: number

      Defines a search weight for this field to prioritize its importance during search operations in the Studio. This setting allows the specified field to be ranked higher in search results compared to other fields.

      By default, all fields are assigned a weight of 1. However, if a field is chosen as the title in the preview configuration's select option, it will automatically receive a default weight of 10. Similarly, if selected as the subtitle, the default weight is 5. Fields marked as hidden: true (no function) are assigned a weight of 0 by default.

      Note: Search weight configuration is currently supported only for fields of type string or portable text arrays.

    sortable?: boolean
    treeEditing?: boolean

    A boolean flag to enable or disable tree editing for the array. If there are any nested arrays, they will inherit this value.

    tree editing beta feature has been disabled