• Stars
    star
    583
  • Rank 76,663 (Top 2 %)
  • Language
    TypeScript
  • Created over 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React components for blurhash

react-blurhash

NPM Version NPM Downloads

React components for using the blurhash algorithm in your React projects

Demo

Install

npm install --save blurhash react-blurhash

Usage

<Blurhash />

import { Blurhash } from "react-blurhash";

Description

Blurhash component is the recommended way to render blurhashes in your React projects. It uses BlurhashCanvas and a wrapping div to scale the decoded image to your desired size. You may control the quality of the decoded image with resolutionX and resolutionY props.

Props

name description
hash (string) The encoded blurhash string.
width (int | string) Width (CSS) of the decoded image.
height (int | string) Height (CSS) of the decoded image.
resolutionX (int) The X-axis resolution in which the decoded image will be rendered at. Recommended min. 32px. Large sizes (>128px) will greatly decrease rendering performance. (Default: 32)
resolutionY (int) The Y-axis resolution in which the decoded image will be rendered at. Recommended min. 32px. Large sizes (>128px) will greatly decrease rendering performance. (Default: 32)
punch (int) Controls the "punch" value (~contrast) of the blurhash decoding algorithm. (Default: 1)

Example

<Blurhash
  hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
  width={400}
  height={300}
  resolutionX={32}
  resolutionY={32}
  punch={1}
/>

<BlurhashCanvas />

import { BlurhashCanvas } from "react-blurhash";

Description

BlurhashCanvas is the barebones implementation of a blurhash string to a canvas. You may want to use it instead of the Blurhash component e.g. if you want to control the scaling yourself.

Props

name description
hash (string) The encoded blurhash string.
width (int) Width of the decoded image.
height (int) Height of the decoded image.
punch (int) Controls the "punch" value (~contrast) of the blurhash decoding algorithm. (Default: 1)

Example

<BlurhashCanvas hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj" width={400} height={300} punch={1} />

Browser support

Blurhash depends on Uint8ClampedArray, which is supported on all mainstream browsers and >=IE11.

More Repositories

1

blurhash

A very compact representation of a placeholder for an image.
C
15,548
star
2

wolt_modal_sheet

This package provides a responsive modal with multiple pages, motion animation for page transitions, and scrollable content within each page.
Dart
491
star
3

wolt-python-package-cookiecutter

Cookiecutter for rapidly creating modern & high-quality Python packages
Python
249
star
4

blurhash-python

Python version of the BlurHash encoder
Python
156
star
5

mitmproxy-mock

A tool to mock/modify server responses easily with mitmproxy
Python
87
star
6

redux-autoloader

A higher order component for declarative data loading in React and Redux.
JavaScript
57
star
7

wolt_responsive_layout_grid

Wolt Responsive Layout Grid library introduces the Flutter implementation of Material Design's responsive layout grid. It provides a unified, multi-platform grid system that ensures consistency and visual integrity regardless of the device or operating system being used.
Dart
56
star
8

parallelpbf

OpenStreetMap PBF format multithreaded reader
Java
54
star
9

engineering-internship-2024

The pre-assignment for frontend / backend internship applicants
50
star
10

magic-di

Dependency Injector with minimal boilerplate code, built-in support for FastAPI and Celery, and seamless integration to basically anything.
Python
39
star
11

engineering-summer-intern-2023

34
star
12

arrow-detekt-rules

Kotlin
32
star
13

engineering-summer-intern-2022

The home assignment for the Wolt Engineering Summer Internships 2022
25
star
14

react-geoinput

Geolocation suggestions and coordinates with Google Maps API for React
JavaScript
20
star
15

react-router-query-params

react-router-query-params
JavaScript
19
star
16

summer2021-internship

Wolt Summer 2021 Internships - Preliminary Assignment for Engineering Positions
19
star
17

data-science-summer-intern-2021

Assignment for Data Science Summer Intern candidates 2021
18
star
18

data-science-internship-2024

The pre-assignment for data science internship applicants
17
star
19

spark-osm-datasource

Native Spark OSM PBF data source
Scala
16
star
20

summer2020

Assignment for engineering intern positions
14
star
21

python-fastapi-workshop

Materials for "Modern Python APIs with FastAPI"
Python
13
star
22

celery-farmer

Python
11
star
23

react-native-assignment

React Native UI programming assignment
JavaScript
11
star
24

analytics-summer-intern-2022

Assignment for Analytics Service Summer Intern candidates for 2022
7
star
25

summer2018

Coding task
6
star
26

data-science-summer-intern-2022

6
star
27

mobile-engineering-internship-2024

The pre-assignment for mobile (Flutter) internship applicants
5
star
28

summer2019

Coding task for summer interns 2019
5
star
29

ktor-idempotency

A Ktor library to handle idempotency checks for HTTP requests
Kotlin
5
star
30

memories

Links and description of tools together with a play project for exploring memory problems
Kotlin
4
star
31

spark-osm-tools

Scala
3
star
32

junction-2022-materials

Materials for the Wolt's Junction 2022 challenge
2
star
33

looker-viz-transposed-table

2
star
34

mongo-vector-embeddings-helsinki-python-meetup-demo

A starter kit for embeddings creation and vector search with Python and MongoDB.
Jupyter Notebook
2
star