Skip to content

Commit 6ab2ebc

Browse files
committed
Apply changesets and update CHANGELOG
1 parent b0a459b commit 6ab2ebc

File tree

1 file changed

+31
-75
lines changed

1 file changed

+31
-75
lines changed

lib/README.md

Lines changed: 31 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
# React Mouse Trail <img src="https://github.com/react18-tools/react-mouse-trail/blob/main/popper.png?raw=true" style="height: 40px"/>
22

3-
[![test](https://github.com/react18-tools/react-mouse-trail/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/react-mouse-trail/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/aa896ec14c570f3bb274/maintainability)](https://codeclimate.com/github/react18-tools/react-mouse-trail/maintainability) [![codecov](https://codecov.io/gh/react18-tools/react-mouse-trail/graph/badge.svg)](https://codecov.io/gh/react18-tools/react-mouse-trail) [![Version](https://img.shields.io/npm/v/react-mouse-trail.svg?colorB=green)](https://www.npmjs.com/package/react-mouse-trail) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/react-mouse-trail.svg)](https://www.npmjs.com/package/react-mouse-trail) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-mouse-trail) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
3+
[![test](https://github.com/react18-tools/react-mouse-trail/actions/workflows/test.yml/badge.svg)](https://github.com/react18-tools/react-mouse-trail/actions/workflows/test.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/4bb3a3316ff4ecd2a9eb/maintainability)](https://codeclimate.com/github/react18-tools/react-mouse-trail/maintainability) [![codecov](https://codecov.io/gh/react18-tools/react-mouse-trail/graph/badge.svg)](https://codecov.io/gh/react18-tools/react-mouse-trail) [![Version](https://img.shields.io/npm/v/react-mouse-trails.svg?colorB=green)](https://www.npmjs.com/package/react-mouse-trails) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/react-mouse-trails.svg)](https://www.npmjs.com/package/react-mouse-trails) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-mouse-trails) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)
44

5-
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.
66

7-
✅ Fully Treeshakable (import from `react-mouse-trail/client/loader-container`)
8-
9-
✅ Fully TypeScript Supported
7+
✅ Fully TypeScript
108

119
✅ Leverages the power of React 18 Server components
1210

13-
✅ Compatible with all React 18 build systems/tools/frameworks
11+
✅ Compatible with all React build systems/tools/frameworks
1412

1513
✅ Documented with [Typedoc](https://react18-tools.github.io/react-mouse-trail) ([Docs](https://react18-tools.github.io/react-mouse-trail))
1614

17-
✅ Examples for Next.js, Vite, and Remix
15+
✅ Examples for Next.js, Vite
1816

1917
> <img src="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.
2018
@@ -23,108 +21,66 @@ React Mouse Trail is a comprehensive library designed to unlock the full potenti
2321
### Installation
2422

2523
```bash
26-
$ pnpm add react-mouse-trail
24+
$ pnpm add react-mouse-trails
2725
```
2826

2927
**_or_**
3028

3129
```bash
32-
$ npm install react-mouse-trail
30+
$ npm install react-mouse-trails
3331
```
3432

3533
**_or_**
3634

3735
```bash
38-
$ yarn add react-mouse-trail
39-
```
40-
41-
## Want Lite Version? [![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-mouse-trail-lite)](https://www.npmjs.com/package/react-mouse-trail-lite) [![Version](https://img.shields.io/npm/v/react-mouse-trail-lite.svg?colorB=green)](https://www.npmjs.com/package/react-mouse-trail-lite) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/d18m/react-mouse-trail-lite.svg)](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
4537
```
4638

47-
**or**
39+
### Adding CSS
4840

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.
5242

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
6444

6545
```css
66-
/* globals.css */
67-
@import "react-mouse-trail/dist";
46+
@import "react-mouse-trails/dist";
6847
```
6948

70-
```tsx
71-
// layout.tsx
49+
or in your component
50+
51+
```ts
7252
import "react-mouse-trail/dist/index.css";
7353
```
7454

75-
For selective imports:
55+
Here's a revised version of the usage section:
7656

77-
```css
78-
/* globals.css */
79-
@import "react-mouse-trail/dist/client"; /** required if you are using LoaderContainer */
80-
@import "react-mouse-trail/dist/server/bars/bars1";
81-
```
57+
## Usage
8258

83-
### Usage
84-
85-
Using loaders is straightforward.
59+
MouseTrail is simple to integrate:
8660

8761
```tsx
88-
import { Bars1 } from "react-mouse-trail/dist/server/bars/bars1";
89-
90-
export default function MyComponent() {
91-
return someCondition ? <Bars1 /> : <>Something else...</>;
62+
import { MouseTrail } from "react-mouse-trail";
63+
64+
export default function Layout() {
65+
return (
66+
<html lang="en" suppressHydrationWarning>
67+
<body className={inter.className}>
68+
{/* ... */}
69+
<MouseTrail rgb={[1, 0, 0]} />
70+
</body>
71+
</html>
72+
);
9273
}
9374
```
9475

95-
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.
10677

107-
```tsx
108-
// some other page or component
109-
import { useLoader } from "react-mouse-trail/dist/hooks";
110-
111-
export default MyComponent() {
112-
const { setLoading } = useLoader();
113-
useCallback(()=>{
114-
setLoading(true);
115-
...do some work
116-
setLoading(false);
117-
}, [])
118-
...
119-
}
120-
```
78+
![Repobeats](https://repobeats.axiom.co/api/embed/016960ad97aa7b1abbdd9a615f5ffeb08d869cb6.svg "Repobeats analytics image")
12179

12280
## License
12381

12482
This library is licensed under the MPL-2.0 open-source license.
12583

126-
127-
12884
> <img src="https://github.com/react18-tools/react-mouse-trail/blob/main/popper.png?raw=true" style="height: 20px"/> Please consider enrolling in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsoring](https://github.com/sponsors/mayank1513) our work.
12985
13086
<hr />

0 commit comments

Comments
 (0)