-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add SkeletonPlaceholder.Item and SkeletonPlaceholder.View
- Loading branch information
Henrique Ramos
committed
Feb 14, 2025
1 parent
a235fb5
commit 843fbc5
Showing
3 changed files
with
50 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,17 +39,21 @@ pod install | |
Using yarn: | ||
|
||
```bash | ||
yarn add [email protected].4 | ||
yarn add [email protected].5 | ||
``` | ||
|
||
Using npm: | ||
|
||
```bash | ||
npm install [email protected].4 --save | ||
npm install [email protected].5 --save | ||
``` | ||
|
||
### Usage | ||
|
||
There are two ways to use this package: | ||
|
||
1. Using **View** | ||
|
||
```javascript | ||
import React from 'react'; | ||
import {View} from 'react-native'; | ||
|
@@ -60,7 +64,7 @@ const App = () => { | |
<SkeletonPlaceholder borderRadius={4}> | ||
<View style={{flexDirection: 'row', gap: 16, alignItems: 'center'}}> | ||
<View style={{width: 60, height: 60, borderRadius: 50}} /> | ||
<View style={{marginLeft: 20, gap: 6}}> | ||
<View style={{gap: 6}}> | ||
<View style={{width: 120, height: 20}} /> | ||
<View style={{width: 80, height: 20}} /> | ||
</View> | ||
|
@@ -70,6 +74,27 @@ const App = () => { | |
}; | ||
``` | ||
|
||
2. Using **SkeletonPlaceholder.Item** or **SkeletonPlaceholder.View** | ||
|
||
```javascript | ||
import React from 'react'; | ||
import SkeletonPlaceholder from 'react-native-skeleton-placeholder'; | ||
const App = () => { | ||
return ( | ||
<SkeletonPlaceholder borderRadius={4}> | ||
<SkeletonPlaceholder.Item flexDirection="row" alignItems="center" gap={20}> | ||
<SkeletonPlaceholder.Item width={60} height={60} borderRadius={50} /> | ||
<SkeletonPlaceholder.Item gap={6}> | ||
<SkeletonPlaceholder.Item width={120} height={20} /> | ||
<SkeletonPlaceholder.Item width={80} height={20} /> | ||
</SkeletonPlaceholder.Item> | ||
</SkeletonPlaceholder.Item> | ||
</SkeletonPlaceholder> | ||
); | ||
}; | ||
``` | ||
|
||
### Properties | ||
|
||
#### SkeletonPlaceholder | ||
|
@@ -85,11 +110,17 @@ const App = () => { | |
|
||
<!-- | enabled | Determines if Skeleton should show placeholders or its children | boolean | true | --> | ||
|
||
<!-- #### SkeletonPlaceholder.Item | ||
#### SkeletonPlaceholder.Item | ||
|
||
| Prop | Description | Type | Default | | ||
| :--: | :------------------------------: | :--: | :-----: | | ||
| any | Any view style props is accepted | any | | ||
|
||
#### SkeletonPlaceholder.View | ||
|
||
| Prop | Description | Type | Default | | ||
| :--: | :-------------------------------: | :--: | :-----: | | ||
| any | Any view style props was accepted | any | --> | ||
| Prop | Description | Type | Default | | ||
| :--: | :------------------------------: | :--: | :-----: | | ||
| any | Any view style props is accepted | any | | ||
|
||
### Contributing | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters