Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mastodon
GitHub Repository: mastodon/joinmastodon
Path: blob/main/components/SkeletonText.tsx
1006 views
1
import classNames from "classnames"
2
3
/**
4
* Placeholder for dynamically-loaded text
5
* @example widths can be added as classNames from the parent to give multiline skeletons an organic feel
6
* ```jsx
7
* <SkeletonText className="w-[40ch]" />
8
* <SkeletonText className="w-[39ch]" />
9
* <SkeletonText className="w-[20ch]" />
10
* ```
11
*/
12
export const SkeletonText = (props) => (
13
<span
14
className={classNames(
15
"inline-block h-[0.75em] w-full max-w-full animate-pulse rounded bg-gray-3",
16
props.className
17
)}
18
/>
19
)
20
export default SkeletonText
21
22