nilbuild/driver.js
关于
轻量、无依赖的 JavaScript 库,用于引导用户在页面上关注不同内容。
开发工具实测星标增长
- 24小时
- +3
- 7天
- +34
- 15天
- +226
- 1个月
- +322
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
Driver.js
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
探索相关项目
加载中…