ํ๋ก์ ํธ
GitHub์์ ๋ณด๊ธฐ
gokcan/react-shimmer
์๊ฐ
๐ ๋น๋๊ธฐ ๋ก๋ฉ์ ์ง์ํ๋ ๊ณ ์ฑ๋ฅ React.js Image ์ปดํฌ๋ํธ
์น ๋ฐ ์ฑ ๊ฐ๋ฐ์ธก์ ๋ ์คํ ์ฆ๊ฐ
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 0
์๋ก ๊ฒน์น๋ ๊ธฐ๊ฐ์ ์์ฆ๊ฐ๋์ด๋ฉฐ ์ผ๋ณ ํฉ๊ณ๊ฐ ์๋๋๋ค. ์ธก์ ๊ฐ์ด ์์ผ๋ฉด ๋น์ ๋ก๋๋ค. ์คํ๋ ๊ด์ฌ๋๋ฅผ ๋ํ๋ด๋ฉฐ ํ์ง์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
README.md
Original
A powerful, customisable, Suspense-like
<img>component that (optionally) simulates a shimmer effect while loading. (with zero dependencies!).
Live Demo

Install
npm i react-shimmer
or
yarn add react-shimmer
Usage
import React from 'react'
import { Image, Shimmer } from 'react-shimmer'
function App() {
return (
<div>
<Image
src='https://source.unsplash.com/random/800x600'
fallback={<Shimmer width={800} height={600} />}
/>
</div>
)
}
import React from 'react'
import { Image, Breathing } from 'react-shimmer'
function App() {
return (
<div>
<Image
src='https://source.unsplash.com/random/800x600'
fallback={<Breathing width={800} height={600} />}
/>
</div>
)
}
or you can use your custom React component as a fallback:
import React from 'react'
import { Image } from 'react-shimmer'
import Spinner from './Spinner'
function App(props) {
return (
<div>
<Image
src="https://example.com/test.jpg"
fallback={<Spinner />}
/>
</div>
)
}
Properties
| Property | Type | Required | Default value | Description |
|---|---|---|---|---|
src |
string | yes | ||
fallback |
ReactNode | yes | ||
errorFallback |
func | no | ||
onLoad |
func | no | ||
delay |
number | no | Delay in milliseconds before showing the fallback |
|
fadeIn |
bool | no | false | Use built-in fade animation on img |
NativeImgProps |
React.ImgHTMLAttributes | no |
Contributing
Feel free to send PRs.
License
MIT ยฉ gokcan
๊ด๋ จ ํ๋ก์ ํธ ์ดํด๋ณด๊ธฐ
๋ถ๋ฌ์ค๋ ์คโฆ