npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@xyflow/svelte

v0.1.24

Published

Svelte Flow - A highly customizable Svelte library for building node-based editors, workflow systems, diagrams and more.

Downloads

92,315

Readme

readme-header readme-header-dark

GitHub License MIT npm downloads

Svelte Flow is a highly customizable component for building interactive graphs and node-based editors, built by the creators of React Flow.

☣️ Svelte Flow is still alpha and currently under heavy development. The API is relatively stable but some things might change. ☣️

🚀 Getting Started | 📖 Documentation | 📺 Examples | ☎️ Discord

Key Features

  • Easy to use: Seamless zooming and panning, single- and multi selection of graph elements and keyboard shortcuts are supported out of the box
  • Customizable: Different node and edge types and support for custom nodes with multiple handles and custom edges
  • Fast rendering: Only nodes that have changed are re-rendered
  • Hooks and Utils: Hooks for handling nodes, edges and the viewport and graph helper functions
  • Plugin Components: Background, MiniMap and Controls
  • Reliable: Written in Typescript and tested with Playwright

Installation

The easiest way to get the latest version of Svelte Flow is to install it via npm, yarn or pnpm:

npm install @xyflow/svelte

Getting started

You only need a few lines to get a fully interactive (e.g. select and drag nodes or pan and zoom) flow. If you want to learn more, please refer to the learn section, the examples or the API reference.

<script lang="ts">
  import { writable } from 'svelte/store';
  import { SvelteFlow, Controls, Background, BackgroundVariant, MiniMap } from '@xyflow/svelte';

  // you need to import the styles for Svelte Flow to work
  // if you just want to load the basic styleds, you can import '@xyflow/svelte/dist/base.css'
  import '@xyflow/svelte/dist/style.css';

  // We are using writables for the nodes and edges to sync them easily. When a user drags a node for example, Svelte Flow updates its position. This also makes it easier to update nodes in user land.
  const nodes = writable([
    {
      id: '1',
      type: 'input',
      data: { label: 'Input Node' },
      position: { x: 0, y: 0 }
    },
    {
      id: '2',
      type: 'custom',
      data: { label: 'Node' },
      position: { x: 0, y: 150 }
    }
  ]);

  // same for edges
  const edges = writable([
    {
      id: '1-2',
      type: 'default',
      source: '1',
      target: '2',
      label: 'Edge Text'
    }
  ]);
</script>

<SvelteFlow {nodes} {edges} fitView on:nodeclick={(event) => console.log('on node click', event)}>
  <Controls />
  <Background variant={BackgroundVariant.Dots} />
  <MiniMap />
</SvelteFlow>

How to Contribute

Show us what you make: Drop it in into our Discord Server, tweet at us, or email us at [email protected]

Community Participation: Ask and answer questions in our Discord Server or jump in on Github discussions.

Squash Bugs: We can’t catch them all. Check existing issues and discussions first, then create a new issue to tell us what’s up.

Financial Support: If you are an organization who wants to make sure Svelte Flow continues to be maintained, reach out to us at [email protected]

And of course, we love Github stars ⭐

Development

If you want to check out the current version you need to run the following command from the root directory:

  1. pnpm install - install dependencies
  2. pnpm build - needs to be done once
  3. pnpm dev - starts dev server

You can now access the examples under http://127.0.0.1:5173

Maintainers

Svelte Flow is maintained by the team behind xyflow. If you need help or want to talk to us about a collaboration, reach out through our contact form or by joining our Discord Server.

License

Svelte Flow is MIT licensed.