You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React Mouse Trail is a comprehensive library designed to unlock the full potential of React 18 server components. It provides customizable loading animation components and a fullscreen loader container, seamlessly integrating with React and Next.js.
5
+
A lightweight WebGL-based React component for creating an interactive mouse trail effect. Works with Next.js out of the box.
6
6
7
-
✅ Fully Treeshakable (import from `react-mouse-trail/client/loader-container`)
8
-
9
-
✅ Fully TypeScript Supported
7
+
✅ Fully TypeScript
10
8
11
9
✅ Leverages the power of React 18 Server components
12
10
13
-
✅ Compatible with all React 18 build systems/tools/frameworks
11
+
✅ Compatible with all React build systems/tools/frameworks
14
12
15
13
✅ Documented with [Typedoc](https://react18-tools.github.io/react-mouse-trail) ([Docs](https://react18-tools.github.io/react-mouse-trail))
16
14
17
-
✅ Examples for Next.js, Vite, and Remix
15
+
✅ Examples for Next.js, Vite
18
16
19
17
> <imgsrc="https://github.com/react18-tools/react-mouse-trail/blob/main/popper.png?raw=true"style="height: 20px"/> Please consider starring [this repository](https://github.com/react18-tools/react-mouse-trail) and sharing it with your friends.
20
18
@@ -23,108 +21,66 @@ React Mouse Trail is a comprehensive library designed to unlock the full potenti
23
21
### Installation
24
22
25
23
```bash
26
-
$ pnpm add react-mouse-trail
24
+
$ pnpm add react-mouse-trails
27
25
```
28
26
29
27
**_or_**
30
28
31
29
```bash
32
-
$ npm install react-mouse-trail
30
+
$ npm install react-mouse-trails
33
31
```
34
32
35
33
**_or_**
36
34
37
35
```bash
38
-
$ yarn add react-mouse-trail
39
-
```
40
-
41
-
## Want Lite Version? [](https://www.npmjs.com/package/react-mouse-trail-lite)[](https://www.npmjs.com/package/react-mouse-trail-lite)[](https://www.npmjs.com/package/react-mouse-trail-lite)
42
-
43
-
```bash
44
-
$ pnpm add react-mouse-trail-lite
36
+
$ yarn add react-mouse-trails
45
37
```
46
38
47
-
**or**
39
+
### Adding CSS
48
40
49
-
```bash
50
-
$ npm install react-mouse-trail-lite
51
-
```
41
+
You can import CSS in your global styles or from your component. In the case of Next.js, you can import global styles only in `layout` or `_app` components.
52
42
53
-
**or**
54
-
55
-
```bash
56
-
$ yarn add react-mouse-trail-lite
57
-
```
58
-
59
-
> You need `r18gs` as a peer-dependency
60
-
61
-
### Import Styles
62
-
63
-
You can import styles globally or within specific components.
43
+
In your stylesheet
64
44
65
45
```css
66
-
/* globals.css */
67
-
@import"react-mouse-trail/dist";
46
+
@import"react-mouse-trails/dist";
68
47
```
69
48
70
-
```tsx
71
-
// layout.tsx
49
+
or in your component
50
+
51
+
```ts
72
52
import"react-mouse-trail/dist/index.css";
73
53
```
74
54
75
-
For selective imports:
55
+
Here's a revised version of the usage section:
76
56
77
-
```css
78
-
/* globals.css */
79
-
@import"react-mouse-trail/dist/client"; /** required if you are using LoaderContainer */
For detailed API and options, refer to [the API documentation](https://react18-tools.github.io/react-mouse-trail).
96
-
97
-
**Using LoaderContainer**
98
-
99
-
`LoaderContainer` is a fullscreen component. You can add this component directly in your layout and then use `useLoader` hook to toggle its visibility.
100
-
101
-
```tsx
102
-
// layout.tsx
103
-
<LoaderContainer />
104
-
...
105
-
```
76
+
By default, the RGB value `[1, 0, 0]` represents the color red.
0 commit comments