SkeletonView
Allows showing a temporary skeleton view while your real view is loading
(code example)
tip
This component support margin modifiers.
note
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#
borderRadiusThe border radius of the skeleton view
number
#
circleWhether the skeleton is a circle (will override the borderRadius)
boolean
#
colorsThe colors of the skeleton view, the array length has to be >=2
string[]
#
customValueCustom value of any type to pass on to SkeletonView and receive back in the renderContent callback.
any
#
heightThe height of the skeleton view
number
#
listPropsProps that are available when using template={SkeletonView.templates.LIST_ITEM}
SkeletonListProps
#
renderContentA 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
#
shimmerStyleAdditional style to the skeleton view
ViewStyle
#
showContentThe content has been loaded, start fading out the skeleton and fading in the content
boolean
#
styleOverride container styles
ViewStyle
#
template#
Accessible through SkeletonView.templates.xxxThe type of the skeleton view.
listItem | content
#
testIDThe component test id
string
#
timesGenerates duplicate skeletons
number
#
timesKeyA key prefix for the duplicated SkeletonViews
string
#
widthThe width of the skeleton view
number