📣 Take the 2024 Svelte Flow Developer Survey

Svelte Flow

LearnReferenceExamples
GitHubDiscordSupport Us
  • API Reference
  • <SvelteFlow />
  • <SvelteFlowProvider />
  • Components
    • <Background />
    • <BaseEdge />
    • <ControlButton />
    • <Controls />
    • <EdgeLabelRenderer />
    • <EdgeLabel />
    • <Handle />
    • <MiniMap />
    • <NodeResizer />
    • <NodeResizeControl />
    • <NodeToolbar />
    • <Panel />
  • Hooks
    • useConnection()
    • useEdges()
    • useHandleConnections()
    • useInternalNode()
    • useNodes()
    • useNodesData()
    • useNodesInitialized()
    • useSvelteFlow()
    • useStore()
    • useUpdateNodeInternals()
  • Types
    • BackgroundVariant
    • ColorMode
    • Connection
    • ConnectionLineType
    • CoordinateExtent
    • DefaultEdgeOptions
    • Edge
    • EdgeMarker
    • EdgeProps
    • FitViewOptions
    • InternalNode
    • KeyDefinition
    • MarkerType
    • Node
    • NodeProps
    • NodeOrigin
    • PanelPosition
    • Position
    • SvelteFlowStore
    • Viewport
    • XYPosition
    • addEdge()
    • getBezierPath()
    • getConnectedEdges()
    • getIncomers()
    • getNodesBounds()
    • getOutgoers()
    • getSimpleBezierPath()
    • getSmoothStepPath()
    • getStraightPath()
    • getViewportForBounds()
    • isEdge()
    • isNode()

On This Page

  • Fields
Question? Give us feedback →Edit this pageWhat's new here?
ReferenceTypes
FitViewOptions

FitViewOptions

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?: (Node | { id: Node['id'] })[];
};

Fields

NameType
#padding?
number
#includeHiddenNodes?
boolean
#minZoom?
number
#maxZoom?
number
#duration?
number
#nodes?
(Partial<Node> & { id: Node['id'] })[]
Last updated on December 9, 2024
Types

A project by the xyflow team

We are building and maintaining open source software for node-based UIs since 2019.

Docs

Quickstart GuideAPI ReferenceExamplesShowcaseSupport Us

Social

DiscordGithubX / TwitterBluesky

xyflow

BlogOpen SourceAboutContact
Careers hiring

Legal

MIT LicenseCode of Conduct

info@xyflow.com — Copyright © 2025 webkid GmbH. All rights reserved — website design by Facu Montanaro