0.0.2 • Published 1 year ago

@annatarhe/blurhash-react v0.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

@annatarhe/blurhash-react

use BlurHash to render placeholder of image

npm install @annatarhe/blurhash-react
yarn add @annatarhe/blurhash-react
pnpm add @annatarhe/blurhash-react
import BlurhashView from "@annatarhe/blurhash-react";

function MyPage() {
  return (
    <BlurhashView
      blurhashValue="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
      src="https://picsum.photos/320/384"
      height={384}
      width={320}
      className="shadow rounded mr-4 -mt-24 w-80 h-96 transition-all duration-300 max-w-xs"
      alt="an awesome image"
    />
  );
}

props

propstypeexampledescription
blurhashValuestringLEHV6nWB2yk8pyo0adR*.7kCMdnjhash value that generated by blurhash
srcstringhttps://picsum.photos/320/384a image url
heightnumber100optional. image height
widthnumber100optional. image width
classNamestringyour-own-classNamesthe classNames will applied to the image
altstringtitlealt title
0.0.2

1 year ago

0.0.1

2 years ago