1.1.2 • Published 1 year ago

hash-image v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Hash-image

Hash image banner

Simple react component which makes blurred placeholder for the image. You can upload initial hash or use default. When picture is loaded, it will became visible.

Usage

import React from 'react';
import { HashImage } from 'hash-image'
import 'hash-image/dist/style.css' // Required styles

const Component: React.FC = () => {
  return (
    <HashImage src="IMAGE SOURCE" alt="ALT" />
  );
}

API

export interface HashImageProps extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
  src: string,
  alt: string,
  width?: number, // Required if fill is false
  height?: number, // Required if fill is false
  fill?: boolean, // Fill the container
  className?: string, // img tag className
  parentClassName?: string, // Parent className
  initialHash?: string, // Initial hash processed by blurhash
  loading?: 'lazy' | 'eager',
}

Licensed under MIT unniiiverse 2024

1.1.1

1 year ago

1.1.2

1 year ago

1.1.0

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.1.1

3 years ago

0.1.0

3 years ago