Sanity Library Reference Docs
    Preparing search index...

    A ListBuilder is used to build a list of items in the structure tool.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    "[serializableMarker]": true

    Brand consumed by isSerializable (avoids circular instanceof imports)

    Methods

    • Append an item for each provided singleton definition id to the list.

      Sugar for .items(singletonIds.map((id) => S.listItem().singleton(id))), but additive: any items previously declared via .items(...) are preserved and the singleton items are appended. Repeated .singletons() calls keep appending.

      Called without arguments, every singleton registered in document.singletons is appended, in registration order.

      Like every other S.list() chain, the caller must still set .id(...) and .title(...) themselves; this helper does not produce a complete list on its own.

      The returned builder omits the items method at the type level, because calling .items() afterwards would replace the whole items array and silently discard the singleton items. See SingletonListBuilder.

      Every id in singletonIds must refer to a registered singleton definition, or a SerializeError is thrown immediately.

      Parameters

      • OptionalsingletonIds: string[]

        the singleton definition ids to render as list items. Defaults to every registered singleton definition id.

      Returns SingletonListBuilder

      list builder with the singleton list items appended