kamrify commited on
Commit
beaaaa0
·
1 Parent(s): 3223525

Refactor basic usage

Browse files
docs/src/content/guides/basic-usage.mdx CHANGED
@@ -6,33 +6,9 @@ sort: 2
6
 
7
  import { CodeSample } from "../../components/CodeSample.tsx";
8
 
9
- Once installed, you can import and start using the library. Given below is a simple example of how to highlight a single element.
10
 
11
- <CodeSample heading='Highlighting a simple Element' id={"some-element"} highlight={{
12
- element: '#some-element',
13
- popover: {
14
- title: 'Title for the Popover',
15
- description: 'Description for it',
16
- },
17
- }} client:load>
18
- ```js
19
- import { driver } from "driver.js";
20
- import "driver.js/dist/driver.css";
21
-
22
- const driverObj = driver();
23
- driverObj.highlight({
24
- element: '#some-element',
25
- popover: {
26
- title: 'Title for the Popover',
27
- description: 'Description for it',
28
- },
29
- });
30
- ```
31
- </CodeSample>
32
-
33
- There are many different options to customize the highlight e.g. change position, change overlay color, control interactions, change buttons etc. You can find more details about the options in the [API Reference](/api-reference).
34
-
35
- The same configuration passed to the `highlight` method can be used to create a tour. Given below is a simple example of how to create a tour with a single step.
36
 
37
  <CodeSample
38
  heading={'Basic Tour Example'}
@@ -65,4 +41,32 @@ const driverObj = driver({
65
 
66
  driver.drive();
67
  ```
68
- </CodeSample>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  import { CodeSample } from "../../components/CodeSample.tsx";
8
 
9
+ Once installed, you can import and start using the library. There are several different configuration options available to customize the library. You can find more details about the options in the [configuration section](/docs/configuration). Given below are the basic steps to get started.
10
 
11
+ Here is a simple example of how to create a tour with multiple steps.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
 
13
  <CodeSample
14
  heading={'Basic Tour Example'}
 
41
 
42
  driver.drive();
43
  ```
44
+ </CodeSample>
45
+
46
+ You can pass a single step configuration to the `highlight` method to highlight a single element. Given below is a simple example of how to highlight a single element.
47
+
48
+ <CodeSample heading='Highlighting a simple Element' id={"some-element"} highlight={{
49
+ element: '#some-element',
50
+ popover: {
51
+ title: 'Title for the Popover',
52
+ description: 'Description for it',
53
+ },
54
+ }} client:load>
55
+ ```js
56
+ import { driver } from "driver.js";
57
+ import "driver.js/dist/driver.css";
58
+
59
+ const driverObj = driver();
60
+ driverObj.highlight({
61
+ element: '#some-element',
62
+ popover: {
63
+ title: 'Title for the Popover',
64
+ description: 'Description for it',
65
+ },
66
+ });
67
+ ```
68
+ </CodeSample>
69
+
70
+ The same configuration passed to the `highlight` method can be used to create a tour. Given below is a simple example of how to create a tour with a single step.
71
+
72
+ Examples above show the basic usage of the library. Find more details about the configuration options in the [configuration section](/docs/configuration) and the examples in the [examples section](/docs/examples).