rn-placeholder v3 Star Available componentsThere are only three components exposed by the library
PlaceholderIt's the wrapper around all of the other components. Using alone will not produce anything interesting. You have put some line or media inside to make it powerful.
It accepts all the props of a React Native View plus:
Animation : An optional animation componentLeft : An optional component to display on the left sideRight : An optional component to display on the right side PlaceholderLineA PlaceholderLine
is one of the two basic and visual components of a placeholder.
function App ( ) {
return (
< Placeholder >
< PlaceholderLine width = { 80 } />
< PlaceholderLine
style = { { backgroundColor : 'green' } }
/>
< PlaceholderLine width = { 30 } />
</ Placeholder >
)
}
A PlaceholderMedia
is the second of the two basic and visual components of a placeholder. It can be used a single placeholder like following:
function App ( ) {
return (
< Placeholder >
< PlaceholderMedia />
</ Placeholder >
)
}
But they become really cool components when associated with the Placeholder
and the PlaceholderLine
ones:
function App ( ) {
return (
< Placeholder
Left = { PlaceholderMedia }
Right = { PlaceholderMedia }
>
< PlaceholderLine width = { 80 } />
< PlaceholderLine />
< PlaceholderLine width = { 30 } />
</ Placeholder >
)
}