Sanity Library Reference Docs
    Preparing search index...

    Interface TemplateItem

    Represents the items that can appear in different parts of the Sanity studio when creating new documents - examples being the "New document" button in the navigation bar, the corresponding button in panes, as well as the "Create new" button on references.

    Differs from an actual template in that a single template can be pointed at by multiple different items. This is useful when the template can create different values based on passed parameters.

    interface TemplateItem {
        icon?: Element | ElementType<any, (keyof IntrinsicElements)>;
        parameters?: { [key: string]: any };
        templateId: string;
        title?: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    icon?: Element | ElementType<any, (keyof IntrinsicElements)>

    React icon for the item, if any. Defaults to the icon for the associated template.

    parameters?: { [key: string]: any }

    Parameters for the template - an object of any JSON-serializable values

    templateId: string

    ID for the template. Must be unique within the set of templates.

    title?: string

    Title for the item. Defaults to the title of the associated template.