File size: 1,285 Bytes
06ea972
 
 
 
e5864b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b3243f
 
e5864b3
 
 
 
 
 
5697c7f
e5864b3
 
3223525
 
e5864b3
 
 
 
 
 
 
 
acbae00
 
 
 
 
e2608a3
acbae00
3223525
51ad881
 
acbae00
 
 
 
 
 
 
 
e2608a3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
title: "Installation"
groupTitle: "Introduction"
sort: 1
---

Run one of the following commands to install the package:

```bash
# Using npm
npm install driver.js

# Using pnpm
pnpm install driver.js

# Using yarn
yarn add driver.js
```

Alternatively, you can use CDN and include the script in your HTML file:

```html
<script src="https://cdn.jsdelivr.net/npm/driver.js@latest/dist/driver.js.iife.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/driver.js@latest/dist/driver.css"/>
```

## Start Using
Once installed, you can import the package in your project. The following example shows how to highlight an element:

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

const driverObj = driver();
driverObj.highlight({
  element: "#some-element",
  popover: {
    title: "Title",
    description: "Description"
  }
});
```

### Note on CDN

If you are using the CDN, you will have to use the package from the `window` object:

```js
const driver = window.driver.js.driver;

const driverObj = driver();

driverObj.highlight({
  element: "#some-element",
  popover: {
    title: "Title",
    description: "Description"
  }
});
```

Continue reading the [Getting Started](/docs/basic-usage) guide to learn more about the package.