Skip to content

Commit 1b70dc9

Browse files
committed
update README
1 parent 35a1e2e commit 1b70dc9

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
# Remix TopLoader
1+
# Remix / React Router TopLoader
22

3-
- A Remix Top Loading bar Component **heavily** inspired by [Next.js TopLoader](https://github.com/TheSGJ/nextjs-toploader). Based on [NProgress](https://www.npmjs.com/package/nprogress)
3+
- A Remix and React Router Top Loading bar Component **heavily** inspired by [Next.js TopLoader](https://github.com/TheSGJ/nextjs-toploader). Based on [NProgress](https://www.npmjs.com/package/nprogress)
44

55
> :exclamation: This is my first package. Contributions are welcomed 👍
66
7-
![Remix Top Loader](https://github.com/user-attachments/assets/99723ebb-c35b-4d47-b14c-577aeaa5aa22)
8-
7+
![Remix/Router v7 Top Loader](https://github.com/user-attachments/assets/99723ebb-c35b-4d47-b14c-577aeaa5aa22)
98

109
## Install
1110

@@ -32,14 +31,18 @@ pnpm add remix-toploader
3231
import using:
3332

3433
```js
34+
// in Remix v2
3535
import RemixTopLoader from "remix-toploader";
36+
// or
37+
import { RemixTopLoader } from "remix-toploader";
38+
39+
// in React Router v7
40+
import { RouterTopLoader } from "remix-toploader";
3641
```
3742

38-
Navide to `root.tsx` of your app and add `<RemixTopLoader />` to the `<body>` tag.
43+
Navigate to `root.tsx` of your app and add `<RemixTopLoader />` to the `<body>` tag.
3944

4045
```js
41-
import RemixTopLoader from "remix-toploader";
42-
4346
export function Layout({ children }) {
4447
return (
4548
<html lang="en">
@@ -50,7 +53,10 @@ export function Layout({ children }) {
5053
<Links />
5154
</head>
5255
<body>
56+
{/* in Remix v2 */}
5357
<RemixTopLoader />
58+
{/* in React Router v7 */}
59+
<RouterTopLoader />
5460
{children}
5561
<ScrollRestoration />
5662
<Scripts />

0 commit comments

Comments
 (0)