diff --git a/docs/skeleton.md b/docs/skeleton.md new file mode 100644 index 000000000..65e573844 --- /dev/null +++ b/docs/skeleton.md @@ -0,0 +1,52 @@ +--- +id: skeleton +title: Skeleton +--- + +import { ComponentTheme } from '../src/components'; + +`Skeleton` is used to display the loading state of a component. + +## Examples + +### Usage + +```ComponentSnackPlayer path=components,composites,Skeleton,Basic.tsx + +``` + +### Color + +```ComponentSnackPlayer path=components,composites,Skeleton,Color.tsx + +``` + +### Composition + +```ComponentSnackPlayer path=components,composites,Skeleton,Composition.tsx + +``` + +### IsLoaded + +```ComponentSnackPlayer path=components,composites,Skeleton,isLoaded.tsx + +``` + +## Props + +### Skeleton + +```ComponentPropTable path=composites,Skeleton,Skeleton.tsx + +``` + +### SkeletonText + +```ComponentPropTable path=composites,Skeleton,SkeletonText.tsx + +``` + +## Styling + + diff --git a/sidebars.js b/sidebars.js index 343c159b0..19182fdba 100644 --- a/sidebars.js +++ b/sidebars.js @@ -115,7 +115,7 @@ module.exports = { 'alert', // 'circularProgress', 'progress', - // 'skeleton', + 'skeleton', // 'snackBar', 'spinner', 'toast', diff --git a/unreleased-docs/skeleton.md b/unreleased-docs/skeleton.md deleted file mode 100644 index e7427c690..000000000 --- a/unreleased-docs/skeleton.md +++ /dev/null @@ -1,137 +0,0 @@ ---- -id: skeleton -title: Skeleton ---- - -import { ComponentTheme } from '../src/components'; - -`Skeleton` is used to display the loading state of a component. - -## Implements - -- [`Box`](box.md) - -## Examples - -### Usage - -```SnackPlayer name=Skeleton%20Usage -import React from 'react'; -import { NativeBaseProvider, Skeleton, Stack, Text, Center } from 'native-base'; -function SkeletonComponent() { - return ( - - - - - - ); -} -export default function () { - return ( - -
- -
-
- ); -} -``` - -### Color - -```SnackPlayer name=Skeleton%20Color -import React from 'react'; -import { NativeBaseProvider, Skeleton, VStack, Center } from 'native-base'; -function SkeletonComponent () { - return ( - - - - - - ); -} -export default function () { - return ( - -
- -
-
- ); -} -``` - -### IsLoaded - -```SnackPlayer name=Skeleton%20IsLoaded -import React from 'react'; -import { NativeBaseProvider, Box, Skeleton, Stack, Text, Avatar, HStack, Image, Center } from 'native-base'; -function Composition({ loaded }: any) { - return ( - - - {loaded ? ( - - ) : ( - - )} - - {loaded ? 'NativeBase' : NativeBase} - - - - {loaded ? ( - NativeBase logo - ) : ( - - )} - - - ); -} - -export default function () { - return ( - -
- - - - -
-
- ); -} -``` - -## Props - -`Skeleton` composes [`Box`](box.md) so you can pass all [`Box props`](box.md#props) to it. - -| Name | Type | Description | Default | -| ---------- | ------------------------ | --------------------------------- | ------- | -| startColor | string | The color at the animation start. | - | -| endColor | string | The color at the animation end. | - | -| variant | `circle`, `rect`, `text` | Variation of Skeleton to use | `text` | -| size | number, string | The size of the Skeleton | - | - -## Styling - -