@vue-flow/core
TypeScript icon, indicating that this package has built-in type declarations

1.41.6 • Public • Published

Vue Flow 🌊

Vue flow top-language GitHub code size in bytes GitHub last commit

Vue Flow: A highly customizable Vue 3 Flowchart component.

You can find a detailed explanation on how to get started here or jump right into the examples.

Table of contents

⭐️ Features

  • 👶 Easy setup: Get started hassle-free - Built-in zoom- & pan features, element dragging, selection and much more

  • 🎨 Customizable: Use your custom nodes, edges and connection lines and expand on Vue Flows' functionality

  • 🚀 Fast: Tracks changes reactively and only re-renders the appropriate elements

  • 🧲 Utils & Composition: Comes with graph helper and state composable functions for advanced uses

  • 📦 Additional Components:

    • 🖼 Background: With two built-in patterns and some configuration options like height, width or color.

    • 🧭 Minimap: Shows current nodes in a small map shape in the bottom right corner

    • 🕹 Controls: Control zoom behavior from a panel on the bottom left

    • 🤖 And (many) more to come...

  • 🦾 Reliable: Fully written in TypeScript

🛠 Setup

$ npm i @vue-flow/core

# or
$ pnpm i @vue-flow/core

# or
$ yarn add @vue-flow/core

🎮 Quickstart

In Vue Flow, an application structure consists of nodes and edges, all of which are categorised as elements.

Each element requires a unique id.

Nodes additionally need an XY-position, while edges require a source and a target, both represented by node ids.

<!-- Flowchart.vue -->
<script setup>
import { ref } from 'vue'  
import { VueFlow } from '@vue-flow/core'

const nodes = ref([
  { id: '1', type: 'input', label: 'Node 1', position: { x: 250, y: 5 } },
  { id: '2', label: 'Node 2', position: { x: 100, y: 100 } },
  { id: '3', label: 'Node 3', position: { x: 400, y: 100 } },
  { id: '4', label: 'Node 4', position: { x: 400, y: 200 } },
])
  
const edges = ref([
  { id: 'e1-2', source: '1', target: '2', animated: true },
  { id: 'e1-3', source: '1', target: '3' },
])
</script>

<template>
  <VueFlow v-model:nodes="nodes" v-model:edges="edges"></VueFlow>
</template>

⚠️ Make sure to import the necessary styles:

/* import the required styles */
@import "@vue-flow/core/dist/style.css";

/* import the default theme (optional) */
@import "@vue-flow/core/dist/theme-default.css";

Do not scope these styles with scoped in your component.

🪴 Vue 2

This library doesn't work with Vue 2.

Vue Flow uses features that are exclusive to Vue 3, therefore there is no support for Vue 2, nor will there be any support in the future, sorry.

🧪 Development

Prerequisites

# install pnpm if you haven't already
$ npm i -g pnpm

# start examples
$ pnpm dev

# build all packages
$ pnpm build

🐳 Dev Container

To start using development containers, install the Docker extension for VSCode. After installing the extension, open the connection menu either on the bottom left or open it via the commands tab. Select the Open Folder in Container option to mount the project.

The development container will spin up all packages example apps and forward the ports to your machine.

discord logo Discord

Join the Vue Flow Discord server!

Here you can ask questions to the community, propose ideas for new features or share your work that you have built with Vue Flow.

💝 Special Thanks

This project is built with

  • React Flow

    • Vue flow is heavily based on webkids' ReactFlow. I wholeheartedly thank them for their amazing work! Without them VueFlow would not exist. Please consider donating or subscribing to ReactFlow Pro.
  • D3.js

    • D3 makes all the zoom and pan actions in Vue Flow possible.
  • VueUse

    • VueUse is a collection of essential vue composition utilities

⭐ Stargazers

Many thanks to the kind individuals who leave a star. Your support is much appreciated!

Stargazers for @vue-flow/core

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.41.615,982latest

Version History

VersionDownloads (Last 7 Days)Published
1.41.615,982
1.41.54,027
1.41.48,496
1.41.31
1.41.26,362
1.41.12,282
1.41.0490
1.40.1868
1.40.01
1.39.3576
1.39.222
1.39.197
1.39.0642
1.38.570
1.38.41
1.38.31
1.38.2203
1.38.13
1.38.08
1.37.1269
1.37.00
1.36.0406
1.35.038
1.34.1450
1.34.084
1.33.8308
1.33.760
1.33.6715
1.33.51,495
1.33.4224
1.33.31
1.33.2101
1.33.183
1.33.015
1.32.191
1.32.00
1.31.01,955
1.30.170
1.30.00
1.29.215
1.29.13
1.29.01
1.28.052
1.27.176
1.27.01
1.26.08,750
1.25.31
1.25.27
1.25.10
1.25.00
1.24.23
1.24.113
1.24.00
1.23.0795
1.22.3690
1.22.283
1.22.124
1.22.01
1.21.32
1.21.27
1.21.16
1.21.00
1.20.2220
1.20.14
1.20.080
1.19.4266
1.19.31
1.19.28
1.19.16
1.19.021
1.18.20
1.18.11
1.18.00
1.17.64
1.17.50
1.17.40
1.17.30
1.17.20
1.17.12
1.17.00
1.16.50
1.16.41
1.16.30
1.16.21
1.16.10
1.16.00
1.15.50
1.15.40
1.15.30
1.15.21
1.15.16
1.15.00
1.14.337
1.14.210
1.14.10
1.14.00
1.13.22
1.13.12
1.13.00
1.12.727
1.12.60
1.12.51
1.12.41
1.12.30
1.12.20
1.12.11
1.12.03
1.11.10
1.11.00
1.10.30
1.10.20
1.10.10
1.10.00
1.9.40
1.9.30
1.9.20
1.9.10
1.9.00
1.8.00
1.7.20
1.7.10
1.7.00
1.6.40
1.6.30
1.6.20
1.6.10
1.6.00
1.5.110
1.5.100
1.5.90
1.5.80
1.5.70
1.5.61
1.5.50
1.5.48
1.5.30
1.5.20
1.5.10
1.5.00
1.4.21
1.4.11
1.4.00
1.3.30
1.3.20
1.3.10
1.3.042
1.2.20
1.2.11
1.2.00
1.1.40
1.1.30
1.1.20
1.1.110
1.1.00
1.0.00
0.4.410

Package Sidebar

Install

npm i @vue-flow/core

Homepage

vueflow.dev

Weekly Downloads

57,797

Version

1.41.6

License

MIT

Unpacked Size

1.24 MB

Total Files

126

Last publish

Collaborators

  • braks