SkeletonView
Allows showing a temporary skeleton view while your real view is loading
(code example)
This component support margin modifiers.
Requires installing the 'react-native-shimmer-placeholder' and 'react-native-linear-gradient' libraries
Usageβ
<SkeletonView template={SkeletonView.templates.LIST_ITEM} showContent={isAvailable} renderContent={<ListItem><Text grey10 text60 marginL-10>The item</Text></ListItem>} times={10} />
APIβ
borderRadiusβ
The border radius of the skeleton view
number
circleβ
Whether the skeleton is a circle (will override the borderRadius)
boolean
colorsβ
The colors of the skeleton view, the array length has to be >=2
string[]
customValueβ
Custom value of any type to pass on to SkeletonView and receive back in the renderContent callback.
any
heightβ
The height of the skeleton view
number
listPropsβ
Props that are available when using template={SkeletonView.templates.LIST_ITEM}
SkeletonListProps
renderContentβ
A function that will render the content once the content is ready (i.e. showContent is true). The method will be called with the Skeleton's customValue (i.e. renderContent(props?.customValue))
(customValue?: any) => React.ReactNode
shimmerStyleβ
Additional style to the skeleton view
ViewStyle
showContentβ
The content has been loaded, start fading out the skeleton and fading in the content
boolean
styleβ
Override container styles
ViewStyle
templateβ
Accessible through SkeletonView.templates.xxxβ
The type of the skeleton view.
listItem | content
testIDβ
The component test id
string
timesβ
Generates duplicate skeletons
number
timesKeyβ
A key prefix for the duplicated SkeletonViews
string
widthβ
The width of the skeleton view
number