@skel-ui/react 1.0.0-alpha.e84c1ff → 1.0.0-alpha.f24f3db
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -45
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,42 +1,39 @@
|
|
|
1
|
-
|
|
1
|
+
Skel UI resolves the challenges of implementing skeletons by eliminating the need to create dedicated loading screens and providing an easier way to manage skeleton states using React Context.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
See the comparision [here](https://skel-ui.augustin.zip/#comparision).
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Get Started
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @skel-ui/react
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Importing CSS
|
|
7
|
+
### Import CSS
|
|
14
8
|
|
|
15
9
|
Import the CSS file into the root of your application.
|
|
16
10
|
|
|
17
|
-
```
|
|
11
|
+
```ts
|
|
18
12
|
import "@skel-ui/react/styles.css";
|
|
19
13
|
```
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
### Implement Skel UI
|
|
22
16
|
|
|
23
17
|
Now it's time for you to craft your user interface to life!
|
|
24
18
|
|
|
25
|
-
```
|
|
19
|
+
```tsx
|
|
26
20
|
import * as Skel from "@skel-ui/react";
|
|
27
|
-
import Image from "
|
|
21
|
+
import Image from "@ui/image";
|
|
28
22
|
|
|
29
|
-
function
|
|
30
|
-
const {
|
|
23
|
+
export default function PostCard() {
|
|
24
|
+
const { post, isLoading } = usePost();
|
|
31
25
|
|
|
32
26
|
return (
|
|
33
27
|
<Skel.Root isLoading={isLoading}>
|
|
34
|
-
<
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
<div className="group w-full max-w-80 p-2.5 bg-white border border-slate-200 rounded-lg overflow-hidden duration-300">
|
|
29
|
+
<Skel.Item
|
|
30
|
+
as={Image}
|
|
31
|
+
src={post?.image}
|
|
32
|
+
className="rounded aspect-[800/530] duration-150 loaded:group-hover:scale-110"
|
|
33
|
+
/>
|
|
34
|
+
<Skel.h1 className="text-xl font-bold mt-4 loading:max-w-48">{post?.title}</Skel.h1>
|
|
35
|
+
<Skel.p className="text-sm my-2 loading:h-[3.75rem]">{post?.description}</Skel.p>
|
|
36
|
+
</div>
|
|
40
37
|
</Skel.Root>
|
|
41
38
|
);
|
|
42
39
|
}
|
|
@@ -44,28 +41,6 @@ function Profile() {
|
|
|
44
41
|
|
|
45
42
|
Now, not only have you designed the skeleton, but you have also done the actual UI. Additionally, the skeleton state for the entire UI is handled in a single place at the `<Skel.Root>` .
|
|
46
43
|
|
|
47
|
-
## Customization
|
|
48
44
|
|
|
49
|
-
Customize the default color and border-radius of skeleton using css variables.
|
|
50
|
-
|
|
51
|
-
```css title="global.css"
|
|
52
|
-
:root {
|
|
53
|
-
--skel-ui-color1: #a1a1aa;
|
|
54
|
-
--skel-ui-color2: #e4e4e7;
|
|
55
|
-
--skel-ui-radius: 0.25rem;
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
45
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```css
|
|
62
|
-
/* This style will be applied during loading. */
|
|
63
|
-
.user-email[data-loading="true"] {
|
|
64
|
-
width: 5rem;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/* This style will be applied after loading is done. */
|
|
68
|
-
.user-email[data-loading="false"]:hover {
|
|
69
|
-
background: #f97316;
|
|
70
|
-
}
|
|
71
|
-
```
|
|
46
|
+
For full documentation, visit [skel-ui.augustin.zip](https://skel-ui.augustin.zip/)
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skel-ui/react",
|
|
3
3
|
"author": "https://github.com/sudoaugustin",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.f24f3db",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "Lightweight and powerful skeleton loading library for React.",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|