SkeletonText.tsx 573 B

123456789101112131415161718192021
  1. import classNames from "classnames"
  2. /**
  3. * Placeholder for dynamically-loaded text
  4. * @example widths can be added as classNames from the parent to give multiline skeletons an organic feel
  5. * ```jsx
  6. * <SkeletonText className="w-[40ch]" />
  7. * <SkeletonText className="w-[39ch]" />
  8. * <SkeletonText className="w-[20ch]" />
  9. * ```
  10. */
  11. export const SkeletonText = (props) => (
  12. <span
  13. className={classNames(
  14. "inline-block h-[0.75em] w-full max-w-full animate-pulse rounded bg-gray-3",
  15. props.className
  16. )}
  17. />
  18. )
  19. export default SkeletonText