Sanity Library Reference Docs
    Preparing search index...

    Interface FormBuilderPropsAlpha

    interface FormBuilderProps {
        autoFocus?: boolean;
        changed: boolean;
        changesOpen?: boolean;
        collapsedFieldSets: StateTree<boolean>;
        collapsedPaths: StateTree<boolean>;
        compareValue?: SanityDocument;
        focused: boolean;
        focusPath: Path;
        groups: FormFieldGroup[];
        hasUpstreamVersion: boolean;
        id: string;
        members: ObjectMember[];
        onChange: (changeEvent: PatchEvent) => void;
        onFieldGroupSelect: (path: Path, groupName: string) => void;
        onPathBlur: (path: Path) => void;
        onPathFocus: (path: Path) => void;
        onPathOpen: (path: Path) => void;
        onSetFieldSetCollapsed: (path: Path, collapsed: boolean) => void;
        onSetPathCollapsed: (path: Path, collapsed: boolean) => void;
        openPath?: Path;
        perspective?: TargetPerspective;
        presence: FormNodePresence[];
        readOnly?: boolean;
        schemaType: ObjectSchemaType;
        validation: ValidationMarker[];
        value: FormDocumentValue;
    }

    Hierarchy (View Summary)

    • Omit<
          ObjectFormNode,
          | "level"
          | "path"
          | "presence"
          | "validation"
          | "_allMembers"
          | "__unstable_computeDiff"
          | "displayInlineChanges",
      >
      • FormBuilderProps
    Index

    Properties

    autoFocus?: boolean
    changed: boolean

    Whether the current value is different to the value the node is being compared to.

    changesOpen?: boolean
    collapsedFieldSets: StateTree<boolean>
    collapsedPaths: StateTree<boolean>
    compareValue?: SanityDocument

    The value the node is currently being compared to. This is taken from the upstream version, if the document has an upstream version. Otherwise, it's taken from the document's current value.

    You can use the hasUpstreamVersion prop to determine whether the document has an upstream version.

    focused: boolean

    Whether the node is focused.

    focusPath: Path

    The focus path of the form node.

    groups: FormFieldGroup[]
    hasUpstreamVersion: boolean

    Whether the document has an upstream version.

    id: string

    The unique identifier of the node.

    members: ObjectMember[]
    onChange: (changeEvent: PatchEvent) => void
    onFieldGroupSelect: (path: Path, groupName: string) => void
    onPathBlur: (path: Path) => void
    onPathFocus: (path: Path) => void
    onPathOpen: (path: Path) => void
    onSetFieldSetCollapsed: (path: Path, collapsed: boolean) => void
    onSetPathCollapsed: (path: Path, collapsed: boolean) => void
    openPath?: Path
    perspective?: TargetPerspective
    presence: FormNodePresence[]
    readOnly?: boolean

    Whether the node is read-only.

    schemaType: ObjectSchemaType

    The schema type of the node.

    validation: ValidationMarker[]

    The value of the node.