Created
March 26, 2022 14:56
-
-
Save LironHazan/cf8609f281d1e158722a85be26d6b8f8 to your computer and use it in GitHub Desktop.
Minimal react svg rect content holder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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