Skip to content

Instantly share code, notes, and snippets.

@LironHazan
Created March 26, 2022 14:56
Show Gist options
  • Save LironHazan/cf8609f281d1e158722a85be26d6b8f8 to your computer and use it in GitHub Desktop.
Save LironHazan/cf8609f281d1e158722a85be26d6b8f8 to your computer and use it in GitHub Desktop.
Minimal react svg rect content holder
export interface RectContentLoaderProps {
placeholderHeight: number;
}
const RectContentLoader = ({ placeholderHeight }: RectContentLoaderProps) => {
return (
<svg height={placeholderHeight}>
<rect
x="0"
y="0"
width="100%"
height={placeholderHeight}
fill="#f6f8fa"
>
<animate
attributeName="opacity"
values="0.5;1;0.5"
dur="500ms"
repeatCount="indefinite"
/>
</rect>
</svg>
);
};
export default RectContentLoader;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment