Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

❇️ (stepper-node) add stepper node component for React Flow #681

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

owaismultani
Copy link

@owaismultani owaismultani commented Feb 21, 2025

🚀 Feature Request: New Stepper Node Component

Overview

Introduce a Stepper Node component that allows users to increment and decrement a numeric value directly within a node. This component is particularly useful in workflows that require:

  • Progress Tracking: Multi-step processes where progress is visually monitored.
  • Approval Stages: Each step represents a decision point.
  • Counter-Based Logic: Managing items, scores, or iterations within a flow.

Use Cases

  1. Progress Tracker: Enable users to step through different phases of a workflow.
  2. Approval Process: Visualize each decision stage with discrete steps.
  3. Counting Mechanism: Track numeric values dynamically within a flow.

Proposed Solution

Create a new StepperNode.tsx component with the following features:

  • Display Elements:

    • Shows a label and step counter.
    • Includes "+" and "–" buttons for adjusting the value.
  • React Flow Integration:

    • Features handles at the top and bottom for linking nodes seamlessly.
  • Design Options:

    • Supports both linear and circular progress designs.
    • Offers both counter and timer modes.
  • State Management:

    • Utilizes localStorage for persistence.
  • Styling:

    • Integrates with ShadCN/UI to maintain styling consistency across components.

Example Usage

const nodeTypes = {
  stepper: StepperNode,
};

const defaultNodes = [
  {
    id: "1",
    position: { x: 100, y: 150 },
    data: {
      label: "Linear Stepper",
      step: 2,
      minStep: 0,
      maxStep: 10,
      stepSize: 1,
      design: "linear",
      mode: "counter",
    },
    type: "stepper",
  },
];

<ReactFlow nodeTypes={nodeTypes} defaultNodes={defaultNodes} fitView />;

Screenshots

image image

Copy link

vercel bot commented Feb 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
example-apps ❌ Failed (Inspect) Feb 21, 2025 5:40pm
ui-components ❌ Failed (Inspect) Feb 21, 2025 5:40pm
xyflow-website ❌ Failed (Inspect) Feb 21, 2025 5:40pm

Copy link

vercel bot commented Feb 21, 2025

@owaismultani is attempting to deploy a commit to the xyflow Team on Vercel.

A member of the Team first needs to authorize it.

@owaismultani owaismultani changed the title :feat:(stepper-node) add stepper node component for React Flow 💄 :(stepper-node) add stepper node component for React Flow Feb 21, 2025
@owaismultani owaismultani changed the title 💄 :(stepper-node) add stepper node component for React Flow ❇️ (stepper-node) add stepper node component for React Flow Feb 21, 2025
@moklick
Copy link
Member

moklick commented Feb 26, 2025

Hey @owaismultani . Thanks for your contribution, this is great! We will discuss with the team how to proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants