Steps

Display numbered sequential steps with auto-incrementing counters, perfect for tutorials, installation guides, and multi-step processes.

Overview

The Steps and Step components work together to create visually appealing numbered step sequences. Using CSS counters, each step automatically increments without manual numbering. The components are ideal for tutorials, setup guides, migration instructions, and any sequential process documentation.

Basic Usage

First Step

This is the content of the first step. The number is automatically generated.

Second Step

Each subsequent step increments the counter automatically.

Third Step

You can include any markdown content inside a step.

Installation Guide Example

Install Dependencies

Install the required packages for your project:

Create Configuration File

Create a vue.config.js file in your project root:

module.exports = {
  publicPath: "/",
  outputDir: "dist",
  assetsDir: "static",
};

Update Package.json

Add scripts to your package.json:

{
  "scripts": {
    "dev": "vite",
    "build": "vite build",
    "preview": "vite preview"
  }
}

Start Development Server

Run the development server:

Tutorial Example

Create Component File

Create a new file MyButton.vue in your components directory.

Add Template

Define your component's structure:

<template>
  <button class="btn">Click me</button>
</template>

Add Script Setup

Add your component logic:

<script setup lang="ts">
  const handleClick = () => {
    console.log("Button clicked!");
  };
</script>

Add Styles

Style your button:

<style scoped>
  .btn {
    padding: 0.5rem 1rem;
    background: #42b883;
    color: white;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
  }

  .btn:hover {
    background: #35495e;
  }
</style>

Import and Use

Import your component in App.vue:

<script setup>
  import MyButton from "./components/MyButton.vue";
</script>

<template>
  <MyButton @click="handleClick" />
</template>

With Lists and Code

Prerequisites

Before you begin, ensure you have:

  • Node.js 18 or higher
  • A package manager (npm, pnpm, yarn, or bun)
  • Basic knowledge of Vue 3
  • A code editor (VS Code recommended)

Project Setup

Initialize a new project:

Navigate to the project:

cd my-project

Install Additional Packages

Add the UI library:

Configure Tailwind

Update your tailwind.config.js:

export default {
  content: [
    "./index.html",
    "./src/**/*.{vue,js,ts,jsx,tsx}",
    "./node_modules/@ui-thing/**/*.{vue,js,ts,jsx,tsx}",
  ],
  theme: {
    extend: {},
  },
  plugins: [],
};

Migration Guide Example

Backup Your Project

Before making changes, create a backup:

git add .
git commit -m "Backup before v2 migration"
git branch backup-v1

Update Dependencies

Update to the latest versions:

Breaking Changes
Version 2.0 includes breaking changes. Review the changelog before proceeding.

Update Component Imports

Change old import syntax:

// Before

// After
import { UiButton } from "ui-thing/components";
import { Button } from "ui-thing/v1";

Update Props

Several components have renamed props:

ComponentOld PropNew Prop
Buttonvariantappearance
InputonChangeUse v-model instead
Modalvisibleopen

Test Your Application

Run your test suite:

Fix any failing tests based on the new API.

Update Styles

Some class names have changed:

- <UiButton class="btn-primary">
+ <UiButton appearance="primary">

Deploy

Once everything is working, deploy your updated application:

Deploy to your hosting provider

API Setup Example

Install Server Framework

Install Express and required middleware:

Create Server File

Create server.js:

import cors from "cors";
import dotenv from "dotenv";
import express from "express";

dotenv.config();

const app = express();
const PORT = process.env.PORT || 3000;

app.use(cors());
app.use(express.json());

app.get("/api/health", (req, res) => {
  res.json({ status: "ok" });
});

app.listen(PORT, () => {
  console.log(`Server running on port ${PORT}`);
});

Configure Environment

Create .env file:

PORT=3000
DATABASE_URL=postgresql://localhost:5432/mydb
JWT_SECRET=your-secret-key

Add Database

Install Prisma for database management:

Initialize Prisma

Set up your database schema:

Create Schema

Define your data models in prisma/schema.prisma:

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique
  name      String?
  createdAt DateTime @default(now())
}

Run Migrations

Create and apply database migrations:

Start Server

Run your API server:

Nested Content

Understanding Components

Components are reusable pieces of UI. They can contain:

  1. Template - The HTML structure
  2. Script - The component logic
  3. Style - The component styling
Single File Components
Vue uses SFC (Single File Components) that combine all three parts in one .vue file.

Component Communication

Components communicate through

  • Props: Pass data from parent to child
  • Emits: Send events from child to parent
  • Provide/Inject: Share data across component tree
  • State Management: Global state (Pinia, Vuex)
  • Best Practices

    Component Guidelines
    Follow these best practices:
    • Keep components small and focused
    • Use TypeScript for type safety
    • Document props and emits
    • Write unit tests
    • Follow naming conventions

    Troubleshooting Guide

    Identify the Issue

    First, gather information about the problem:

    • What error message do you see?
    • When did the issue start?
    • What were you doing when it occurred?
    • Can you reproduce it consistently?

    Check the Console

    Open browser DevTools (F12) and look for:

  • Red error messages
  • Warning messages
  • Network failures
  • Review Recent Changes

    Use git to check recent modifications:

    git log --oneline -10
    git diff HEAD~1
    

    Search Documentation

    Check if this is a known issue:

    1. Search the official docs
    2. Check GitHub issues
    3. Look for related discussions
    4. Review the changelog

    Try Basic Solutions

    Common fixes:

    Ask for Help

    If you're still stuck, ask for help with:

    • A clear description of the problem
    • Steps to reproduce
    • Your environment details (OS, Node version, etc.)
    • Relevant code snippets
    • Error messages and stack traces
    Get Help
    Post your issue on:
    • GitHub Issues
    • Discord community
    • Stack Overflow

    Props

    Steps

    PropTypeDefaultDescription
    classany-Additional CSS classes for the container

    Step

    PropTypeDefaultDescription
    classany-Additional CSS classes for the step item

    How It Works

    The components use CSS counters to automatically number steps:

    1. Steps - Initializes the counter with [counter-reset:_step]
    2. Step - Displays and increments the counter with before:content-[counter(step)] and before:[counter-increment:_step]

    This means you don't need to manually number your steps - the browser handles it automatically!

    Styling

    The step indicator is created using CSS ::before pseudo-element:

    • Size: 32px x 32px (8 Tailwind units)
    • Background: Secondary color
    • Text: Secondary foreground color
    • Position: Absolute, left of the step content
    • Border: Left border connects all steps

    Custom Styling

    You can customize the appearance with the class prop:

    Customized Step

    This step has a primary colored indicator.

    Vue Component Usage

    <template>
      <div>
        <!-- Basic usage -->
        <Steps>
          <Step>
            <h3>First Step</h3>
            <p>Step content goes here</p>
          </Step>
          <Step>
            <h3>Second Step</h3>
            <p>More content</p>
          </Step>
        </Steps>
    
        <!-- With custom classes -->
        <Steps class="border-primary">
          <Step class="before:bg-primary">
            <h3>Custom Styled Step</h3>
            <p>Custom indicator color</p>
          </Step>
        </Steps>
      </div>
    </template>
    

    Best Practices

    Tips for Using Steps
    • Use clear, action-oriented headings (e.g., "Install Dependencies" not "Dependencies")
    • Keep each step focused on one task
    • Include code examples where appropriate
    • Add visual elements (callouts, icons) to enhance clarity
    • Consider using collapsibles for optional or advanced content
    • Test the flow to ensure steps are in logical order
    • Use consistent heading levels (usually ### for step titles)

    Accessibility

    The components provide a clear visual hierarchy:

    • Numbers help users track progress
    • Vertical line shows connection between steps
    • Clear spacing between steps
    • Works with keyboard navigation
    • Compatible with screen readers

    Common Patterns

    Installation + Configuration

    Perfect for documenting software setup:

    Install

    Configure

    Add to your config file...

    Use

    Import and use the package...

    Problem → Solution

    Document troubleshooting workflows:

    Identify Issue

    Check error messages...

    Find Cause

    Debug the problem...

    Apply Fix

    Implement the solution...

    Verify

    Test that it works...

    Before → During → After

    Show transformation processes:

    Preparation

    Set up your environment...

    Execution

    Run the migration...

    Validation

    Verify the changes...