Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 28, 2026·2 min de lecture

Driver.js — Interactive Product Tours for the Web

A lightweight JavaScript library for creating step-by-step guided tours and feature highlights with no external dependencies.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Driver.js Overview
Commande d'installation directe
npx -y tokrepo@latest install f967afbe-5a29-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

Introduction

Driver.js is a vanilla JavaScript engine for creating interactive guided tours, feature introductions, and contextual help overlays. It uses no external dependencies and works across all modern browsers by manipulating a simple SVG overlay to focus attention on specific page elements.

What Driver.js Does

  • Highlights any DOM element with an animated overlay cutout
  • Supports multi-step guided tours with previous/next navigation
  • Provides non-intrusive popovers for feature announcements
  • Allows programmatic control of tour flow and step transitions
  • Works with any frontend framework (React, Vue, Svelte, Angular)

Architecture Overview

Driver.js renders an SVG overlay on top of the page and calculates the bounding rectangle of each highlighted element. The library positions a popover adjacent to the cutout, handling scroll and resize events. All state is managed in a lightweight internal store with no virtual DOM.

Self-Hosting & Configuration

  • Install via npm, yarn, or pnpm, or load from a CDN script tag
  • Import the CSS file for default popover and overlay styles
  • Configure global options like animation duration, overlay color, and opacity
  • Customize popover placement with side and align properties
  • Hook into lifecycle callbacks: onHighlightStarted, onHighlighted, onDeselected

Key Features

  • Zero dependencies and under 5 KB gzipped
  • Animated transitions between highlighted elements
  • Keyboard navigation support with customizable shortcuts
  • Mobile-friendly with responsive positioning
  • Fully typed with TypeScript declarations included

Comparison with Similar Tools

  • Intro.js — More feature-rich but larger bundle size and requires a license for commercial use
  • Shepherd.js — Uses Floating UI for positioning, heavier but more flexible theming
  • React Joyride — React-specific wrapper; Driver.js is framework-agnostic
  • Guided Tour (Angular) — Angular-only; Driver.js works with any stack

FAQ

Q: Does Driver.js work with single-page applications? A: Yes. You can trigger highlights programmatically on route changes or component mounts.

Q: Can I style the popovers? A: Yes. Override the default CSS classes or pass custom popover render functions.

Q: Is it accessible? A: Driver.js supports keyboard navigation and focus management out of the box.

Q: Is a license required for commercial use? A: Driver.js is MIT-licensed and free for both personal and commercial projects.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires