placeholder-pattern.tsx 628 B

1234567891011121314151617181920
  1. import { useId } from 'react';
  2. interface PlaceholderPatternProps {
  3. className?: string;
  4. }
  5. export function PlaceholderPattern({ className }: PlaceholderPatternProps) {
  6. const patternId = useId();
  7. return (
  8. <svg className={className} fill="none">
  9. <defs>
  10. <pattern id={patternId} x="0" y="0" width="10" height="10" patternUnits="userSpaceOnUse">
  11. <path d="M-3 13 15-5M-5 5l18-18M-1 21 17 3"></path>
  12. </pattern>
  13. </defs>
  14. <rect stroke="none" fill={`url(#${patternId})`} width="100%" height="100%"></rect>
  15. </svg>
  16. );
  17. }