Skip to content
Proyek

Tentang

Pustaka JavaScript yang ringan dan tanpa dependensi untuk memandu fokus pengguna di seluruh halaman.

Alat pengembangan

Cara angka ini diukur

27,333 bintang1,230 Fork +3 dalam 24 jam

Pertumbuhan bintang terukur

dalam 24 jam
+3
dalam 7 hari
+34
dalam 15 hari
+226
dalam 1 bulan
+322

Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.

README.md

Asli




Driver.js

jsdelivr hits downloads

Product tours, highlights, hints and onboarding checklists for the web
No dependencies, written in TypeScript, works with any framework


  • Tours: walk users through your app step by step
  • Action-driven steps: wait for the user to click, type or pick, and give feedback on wrong actions
  • Highlights: dim the page around any element, with or without a popover
  • Hints: pulsing beacons that open a popover on click, without blocking the page
  • Checklists: an onboarding widget whose items start tours and tick themselves off
  • Accessible: keyboard control, focus management and screen reader announcements
  • Themeable: plain CSS classes and variables
  • MIT licensed: free for personal and commercial use

Install

npm install driver.js

Usage

import { driver } from "driver.js";
import "driver.js/dist/driver.css";

const driverObj = driver({
  showProgress: true,
  steps: [
    { element: "#search", popover: { title: "Search", description: "Find anything from here." } },
    { element: "#new-project", popover: { title: "New project", description: "Start your first project." } },
  ],
});

driverObj.drive();

Highlight a single element:

driverObj.highlight({
  element: "#search",
  popover: { title: "Search", description: "Find anything from here." },
});

Make a step wait for the user:

const driverObj = driver({
  steps: [
    {
      element: "#new-project",
      advanceOn: "click",
      popover: { title: "Start a project", instruction: "Click <b>New project</b>." },
    },
    {
      element: "#project-name",
      waitForElement: 3000,
      popover: { title: "Name it", description: "Give your project a name." },
    },
  ],
});

Hints, checklists and headless tours are separate entries: driver.js/hints, driver.js/checklist and driver.js/headless.

Documentation

Guides, live demos and the full reference are on driverjs.com.

Developing locally

This is a pnpm monorepo. The library is in packages/driver, the playground in apps/playground and the docs site in apps/docs. Both apps import the library from source, so changes show up right away.

pnpm install
pnpm dev        # Playground
pnpm docs:dev   # Docs site
pnpm test       # Unit tests, in watch mode
pnpm test:e2e   # Playwright tests against the playground
pnpm build

Playground examples live in apps/playground/src/examples.

Contributions

Pull requests and issues are welcome.

License

MIT © Kamran Ahmed

Jelajahi proyek terkait

Memuat…