Sanity Library Reference Docs
    Preparing search index...

    Class DocumentBuilder

    A DocumentBuilder is used to build a document node.

    Implements

    Index

    Constructors

    Methods

    • Set the view IDs to open as split panes by default when the document is opened. Pass an array of view IDs that match the IDs defined in views(). If specified with 2+ valid view IDs, the document will open in split-pane mode.

      Parameters

      • viewIds: string[]

        Array of view IDs to open as split panes

      Returns DocumentBuilder

      document builder with defaultPanes config. See DocumentBuilder

      S.document()
      .schemaType('article')
      .views([
      S.view.form().id('editor'),
      S.view.component(PreviewPane).id('preview').title('Preview')
      ])
      .defaultPanes(['editor', 'preview']) // Opens both as split panes