Last modified: 4/Oct/2024
Loading Block
Loading indicators express an unspecified wait time or display the skeleton before the content appears.
#Usage
import { useState } from 'react'
import { LoadingBlock } from '@kinsta/stratus'
const MyComponent = () => {
const [loading, setLoading] = useState(false)
return loading ? <LoadingBlock /> : <div>My Content</div>
}
Or you can use the LoadingCell
standalone if you want to indicate the loading of a single element instead
of a complex structure:
import { LoadingCell } from '@kinsta/stratus'
const MyComponent = () => <LoadingCell />
#Props
#itemNumber
number
Number of randomly sized skeleton blocks you want to render
#Types
LoadingBlockProps
: props of theLoadingBlock
component processed by stratus
Read more about types here