@skel-ui/react-native 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 +52 -48
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,71 +1,75 @@
|
|
|
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
|
-
|
|
7
|
+
### Add Skel Provider
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
npm install @skel-ui/react
|
|
11
|
-
```
|
|
9
|
+
Wrap your application with Skel UI provider.
|
|
12
10
|
|
|
13
|
-
## Importing CSS
|
|
14
11
|
|
|
15
|
-
|
|
12
|
+
```tsx
|
|
13
|
+
import * as Skel from "@skel-ui/react-native";
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export default function App() {
|
|
16
|
+
return <Skel.Provider> ... </Skel.Provider>;
|
|
17
|
+
}
|
|
19
18
|
```
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
### Implement Skel UI
|
|
22
21
|
|
|
23
22
|
Now it's time for you to craft your user interface to life!
|
|
24
23
|
|
|
25
|
-
```
|
|
26
|
-
import * as Skel from "@skel-ui/react";
|
|
27
|
-
import
|
|
24
|
+
```tsx
|
|
25
|
+
import * as Skel from "@skel-ui/react-native";
|
|
26
|
+
import RN from "react-native";
|
|
28
27
|
|
|
29
|
-
function
|
|
30
|
-
const {
|
|
28
|
+
export default function PostCard() {
|
|
29
|
+
const { post, isLoading } = usePost();
|
|
31
30
|
|
|
32
31
|
return (
|
|
33
32
|
<Skel.Root isLoading={isLoading}>
|
|
34
|
-
<
|
|
35
|
-
<Image src={
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
33
|
+
<RN.View style={styles.card}>
|
|
34
|
+
<Skel.Image src={post?.image} style={styles.cardImage} />
|
|
35
|
+
<Skel.Text sw="65%" style={styles.cardTitle}>
|
|
36
|
+
{post?.title}
|
|
37
|
+
</Skel.Text>
|
|
38
|
+
<Skel.Text numberOfLines={3} style={styles.cardDescription}>
|
|
39
|
+
{post?.description}
|
|
40
|
+
</Skel.Text>
|
|
41
|
+
</RN.View>
|
|
40
42
|
</Skel.Root>
|
|
41
43
|
);
|
|
42
44
|
}
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
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
|
-
|
|
47
|
-
## Customization
|
|
48
|
-
|
|
49
|
-
Customize the default color and border-radius of skeleton using css variables.
|
|
50
45
|
|
|
51
|
-
|
|
52
|
-
:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
const styles = RN.StyleSheet.create({
|
|
47
|
+
card: {
|
|
48
|
+
width: 320,
|
|
49
|
+
padding: 10,
|
|
50
|
+
marginHorizontal: "auto",
|
|
51
|
+
borderWidth: 1,
|
|
52
|
+
borderColor: "#e2e8f0",
|
|
53
|
+
borderRadius: 8,
|
|
54
|
+
},
|
|
55
|
+
cardImage: {
|
|
56
|
+
borderRadius: 4,
|
|
57
|
+
aspectRatio: 800 / 530,
|
|
58
|
+
},
|
|
59
|
+
cardTitle: {
|
|
60
|
+
marginTop: 16,
|
|
61
|
+
marginBottom: 8,
|
|
62
|
+
fontSize: 24,
|
|
63
|
+
lineHeight: 28,
|
|
64
|
+
fontWeight: 800,
|
|
65
|
+
},
|
|
66
|
+
cardDescription: {
|
|
67
|
+
fontSize: 14,
|
|
68
|
+
lineHeight: 20,
|
|
69
|
+
},
|
|
70
|
+
});
|
|
57
71
|
```
|
|
58
72
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
```css
|
|
62
|
-
/* This style will be applied during loading. */
|
|
63
|
-
.user-email[data-loading="true"] {
|
|
64
|
-
width: 5rem;
|
|
65
|
-
}
|
|
73
|
+
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>` .
|
|
66
74
|
|
|
67
|
-
|
|
68
|
-
.user-email[data-loading="false"]:hover {
|
|
69
|
-
background: #f97316;
|
|
70
|
-
}
|
|
71
|
-
```
|
|
75
|
+
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-native",
|
|
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
|
],
|