Sanity Library Reference Docs
    Preparing search index...

    Interface TextOptions

    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 TextOptions {
        canvasApp?: CanvasAppOptions;
        direction?: "horizontal" | "vertical";
        layout?: "radio" | "dropdown";
        list?: (string | TitledListValue<string>)[];
        sanityCreate?: SanityCreateOptions;
        search?: { weight?: number };
    }

    Hierarchy (View Summary)

    Index

    Properties

    canvasApp?: CanvasAppOptions
    direction?: "horizontal" | "vertical"
    layout?: "radio" | "dropdown"
    list?: (string | TitledListValue<string>)[]
    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.