Sanity Library Reference Docs
    Preparing search index...

    Interface WorkflowDiagramProps

    interface WorkflowDiagramProps {
        currentStage?: string;
        definition: {
            description?: string;
            fields?: FieldEntry[];
            groups?: Group[];
            initialStage: string;
            lifecycle?: WorkflowLifecycle;
            name: string;
            predicates?: Record<string, string>;
            roleAliases?: RoleAliases;
            semantics?: Semantic[];
            stages: Stage[];
            start?: StartBlock;
            title: string;
        };
        devMode?: boolean;
        evaluation?: WorkflowEvaluation;
        explain?: boolean;
        fill?: boolean;
        gatedTransitions?: readonly string[];
        height?: string
        | number;
        history?: readonly HistoryEntry[];
        local?: LocalView;
        static?: boolean;
    }
    Index

    Properties

    currentStage?: string

    Highlight this stage as where the instance is now.

    definition: {
        description?: string;
        fields?: FieldEntry[];
        groups?: Group[];
        initialStage: string;
        lifecycle?: WorkflowLifecycle;
        name: string;
        predicates?: Record<string, string>;
        roleAliases?: RoleAliases;
        semantics?: Semantic[];
        stages: Stage[];
        start?: StartBlock;
        title: string;
    }

    The whole definition, not just its stages: definition-level vocabulary (field titles, author predicates) feeds features like human-language explanations, so the contract asks for it up front.

    devMode?: boolean

    Tooling mode: tooltips additionally show machine names and raw GROQ conditions. Never on for end users.

    evaluation?: WorkflowEvaluation

    Upgrades the explanations where it speaks: the current stage's transitions and gates get real ✓/✗ verdicts, the rest of the chart stays static. Only read when WorkflowDiagramProps.explain is on — that's the feature gate, this is its data.

    explain?: boolean

    Explain the workflow in human language: tooltips gain each gate's phrased requirements ("«Review decision» must be 'approve'") — derived from the definition alone, so it works without an instance.

    fill?: boolean

    Span the parent instead of hugging the graph: height renders as given rather than as a ceiling, so '100%' fills a sized parent. The graph fits centred inside, never scaled past 1:1.

    gatedTransitions?: readonly string[]

    Names of current-stage transitions that cannot fire yet — their markers show a lock ("can't proceed, criteria unmet").

    height?: string | number

    Height CEILING: the canvas hugs the laid-out content (and centers in its parent) when the graph is smaller than this. No ceiling under WorkflowDiagramProps.fill — the value renders as given.

    history?: readonly HistoryEntry[]

    Instance history; tones visited stages and traversed transitions.

    local?: LocalView

    Context snippet around the current stage instead of the whole workflow: only the current stage's own transitions render (LocalView.show picks next / previous / both). The hidden side collapses into short ghost-anchored stubs whose tooltips name the hidden stage. Requires currentStage.

    static?: boolean

    Frozen canvas: no pan/zoom, no zoom controls — shows its initial fit. Tooltips and hover highlight stay live.