Skip to content

This is a simple and interactive multi-step guide built with Vite and React. The project demonstrates how to navigate through different stages using state management in React.๐Ÿ› ๏ธ

Notifications You must be signed in to change notification settings

ramxcodes/Steps-Component

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Overview ๐Ÿš€

Welcome to the Steps Component project! This is a simple and interactive multi-step guide built with Vite and React. The project demonstrates how to navigate through different stages using state management in React.๐Ÿ› ๏ธ

Preview Link ๐Ÿ”—

Tech & Features ๐Ÿ–ฅ๏ธ

Tech Stack ๐Ÿ› ๏ธ

  • Vite: A fast and lightweight build tool optimized for modern web development โšก
  • React: A popular library for building dynamic user interfaces โš›๏ธ
  • CSS: Styled using basic CSS for clean and minimal design ๐ŸŽจ

Features โœจ

  • Step Navigation: Users can move between steps using "Previous" and "Next" buttons โฌ…๏ธโžก๏ธ
  • Dynamic Step Highlighting: The current step is highlighted for visual clarity ๐Ÿ”
  • Responsive Layout: The component is built to adapt to different screen sizes ๐Ÿ“ฑ๐Ÿ’ป

How to Use ๐Ÿ› ๏ธ

To get started, follow these simple steps:

  1. Clone the repository: ๐ŸŒ€

    git clone https://github.com/ramxcodes/Steps-Component
  2. Navigate into the project directory: ๐Ÿ“

    cd Steps-Component
  3. Install dependencies: ๐Ÿ“ฆ

    npm install
  4. Start the development server: ๐Ÿš€

    npm run dev
  5. Open your browser and go to: ๐ŸŒ

    http://localhost:5173/
    

Code Overview ๐Ÿ”

The component is structured with React's useState to manage the current step. Below is an overview of the main App component:

import { useState } from "react";

const messages = [
  "Learn React โš›๏ธ",
  "Apply for jobs ๐Ÿ’ผ",
  "Invest your new income ๐Ÿค‘",
];

function App() {
  const [step, setStep] = useState(1);

  function handlePrevious() {
    if (step > 1) setStep(step - 1);
  }

  function handleNext() {
    if (step < 3) setStep(step + 1);
  }

  return (
    <div className="steps">
      <div className="numbers">
        <div className={step >= 1 ? "active" : ""}>1</div>
        <div className={step >= 2 ? "active" : ""}>2</div>
        <div className={step >= 3 ? "active" : ""}>3</div>
      </div>
      <p className="message">
        Step {step} : {messages[step - 1]}
      </p>
      <div className="buttons">
        <button
          style={{ backgroundColor: "#7950f2", color: "#fff" }}
          onClick={handlePrevious}
        >
          Previous
        </button>
        <button
          style={{ backgroundColor: "#7950f2", color: "#fff" }}
          onClick={handleNext}
        >
          Next
        </button>
      </div>
    </div>
  );
}

export default App;

About

This is a simple and interactive multi-step guide built with Vite and React. The project demonstrates how to navigate through different stages using state management in React.๐Ÿ› ๏ธ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published