|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Home |
| 4 | +nav_order: 1 |
| 5 | +--- |
| 6 | + |
| 7 | +# Git Json Resolver Semver <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 40px"/> |
| 8 | + |
| 9 | +[](https://github.com/react18-tools/git-json-resolver-semver/actions/workflows/test.yml) |
| 10 | +[](https://qlty.sh/gh/react18-tools/projects/git-json-resolver-semver) |
| 11 | +[](https://codecov.io/gh/react18-tools/git-json-resolver-semver) |
| 12 | +[](https://www.npmjs.com/package/git-json-resolver-semver) |
| 13 | +[](https://www.npmjs.com/package/git-json-resolver-semver) |
| 14 | + |
| 15 | + |
| 16 | +Git Json Resolver Semver 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. |
| 17 | + |
| 18 | +✅ Fully Treeshakable (import from `git-json-resolver-semver/client/loader-container`) |
| 19 | + |
| 20 | +✅ Fully TypeScript Supported |
| 21 | + |
| 22 | +✅ Leverages the power of React 18 Server components |
| 23 | + |
| 24 | +✅ Compatible with all React 18 build systems/tools/frameworks |
| 25 | + |
| 26 | +✅ Documented with [Typedoc](https://react18-tools.github.io/git-json-resolver-semver) ([Docs](https://react18-tools.github.io/git-json-resolver-semver)) |
| 27 | + |
| 28 | +✅ Examples for Next.js, and Vite |
| 29 | + |
| 30 | +> <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 20px"/> Star [this repository](https://github.com/react18-tools/git-json-resolver-semver) and share it with your friends. |
| 31 | +
|
| 32 | +## Getting Started |
| 33 | + |
| 34 | +### Installation |
| 35 | + |
| 36 | +```bash |
| 37 | +pnpm add git-json-resolver-semver |
| 38 | +``` |
| 39 | + |
| 40 | +**_or_** |
| 41 | + |
| 42 | +```bash |
| 43 | +npm install git-json-resolver-semver |
| 44 | +``` |
| 45 | + |
| 46 | +**_or_** |
| 47 | + |
| 48 | +```bash |
| 49 | +yarn add git-json-resolver-semver |
| 50 | +``` |
| 51 | + |
| 52 | +## Want Lite Version? [](https://www.npmjs.com/package/git-json-resolver-semver-lite) [](https://www.npmjs.com/package/git-json-resolver-semver-lite) [](https://www.npmjs.com/package/git-json-resolver-semver-lite) |
| 53 | + |
| 54 | +```bash |
| 55 | +pnpm add git-json-resolver-semver-lite |
| 56 | +``` |
| 57 | + |
| 58 | +**or** |
| 59 | + |
| 60 | +```bash |
| 61 | +npm install git-json-resolver-semver-lite |
| 62 | +``` |
| 63 | + |
| 64 | +**or** |
| 65 | + |
| 66 | +```bash |
| 67 | +yarn add git-json-resolver-semver-lite |
| 68 | +``` |
| 69 | + |
| 70 | +> You need `r18gs` as a peer-dependency |
| 71 | +
|
| 72 | +### Import Styles |
| 73 | + |
| 74 | +You can import styles globally or within specific components. |
| 75 | + |
| 76 | +```css |
| 77 | +/* globals.css */ |
| 78 | +@import "git-json-resolver-semver/dist"; |
| 79 | +``` |
| 80 | + |
| 81 | +```tsx |
| 82 | +// layout.tsx |
| 83 | +import "git-json-resolver-semver/dist/index.css"; |
| 84 | +``` |
| 85 | + |
| 86 | +For selective imports: |
| 87 | + |
| 88 | +```css |
| 89 | +/* globals.css */ |
| 90 | +@import "git-json-resolver-semver/dist/client"; /** required if you are using LoaderContainer */ |
| 91 | +@import "git-json-resolver-semver/dist/server/bars/bars1"; |
| 92 | +``` |
| 93 | + |
| 94 | +### Usage |
| 95 | + |
| 96 | +Using loaders is straightforward. |
| 97 | + |
| 98 | +```tsx |
| 99 | +import { Bars1 } from "git-json-resolver-semver/dist/server/bars/bars1"; |
| 100 | + |
| 101 | +export default function MyComponent() { |
| 102 | + return someCondition ? <Bars1 /> : <>Something else...</>; |
| 103 | +} |
| 104 | +``` |
| 105 | + |
| 106 | +For detailed API and options, refer to [the API documentation](https://react18-tools.github.io/git-json-resolver-semver). |
| 107 | + |
| 108 | +**Using LoaderContainer** |
| 109 | + |
| 110 | +`LoaderContainer` is a fullscreen component. You can add this component directly in your layout and then use `useLoader` hook to toggle its visibility. |
| 111 | + |
| 112 | +```tsx |
| 113 | +// layout.tsx |
| 114 | +<LoaderContainer /> |
| 115 | + ... |
| 116 | +``` |
| 117 | + |
| 118 | +```tsx |
| 119 | +// some other page or component |
| 120 | +import { useLoader } from "git-json-resolver-semver/dist/hooks"; |
| 121 | + |
| 122 | +export default MyComponent() { |
| 123 | + const { setLoading } = useLoader(); |
| 124 | + useCallback(()=>{ |
| 125 | + setLoading(true); |
| 126 | + ...do some work |
| 127 | + setLoading(false); |
| 128 | + }, []) |
| 129 | + ... |
| 130 | +} |
| 131 | +``` |
| 132 | + |
| 133 | +## License |
| 134 | + |
| 135 | +This library is licensed under the MPL-2.0 open-source license. |
| 136 | + |
| 137 | +> <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 20px"/> Please enroll in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsor](https://github.com/sponsors/mayank1513) our work. |
| 138 | + |
| 139 | +<hr /> |
| 140 | + |
| 141 | +<p align="center" style="text-align:center">with 💖 by <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a></p> |
| 142 | + |
| 143 | +## Modules |
| 144 | + |
| 145 | +- [index](index.md) |
| 146 | +- [index.test](index.test.md) |
0 commit comments