💡 This is the legacy site for v11. If you are looking for the latest docs, please visit React Flow
Reference
FitViewOptions

FitViewOptions

Source on GitHub (opens in a new tab)

When calling fitView these options can be used to customize the behaviour. For example, the duration option can be used to transform the viewport smoothly over a given amount of time.

export type FitViewOptions = {
  padding?: number;
  includeHiddenNodes?: boolean;
  minZoom?: number;
  maxZoom?: number;
  duration?: number;
  nodes?: (Partial<Node> & { id: Node['id'] })[];
};

Fields

#padding?
number
#includeHiddenNodes?
boolean
#minZoom?
number
#maxZoom?
number
#duration?
number
#nodes?
(Partial<Node> & { id: Node['id'] })[]