# rntpc_react-native-blurhash
**Repository Path**: openharmony-sig/rntpc_react-native-blurhash
## Basic Information
- **Project Name**: rntpc_react-native-blurhash
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: https://gitee.com/openharmony-sig/rntpc_react-native-blurhash
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-10-14
- **Last Updated**: 2025-05-07
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 🚨 **重要提示 | IMPORTANT**
>
> **⚠️ 此代码仓已归档。新地址请访问 [rntpc_react-native-blurhash](https://gitcode.com/openharmony-sig/rntpc_react-native-blurhash)。| ⚠️ This repository has been archived. For the new address, please visit [rntpc_react-native-blurhash](https://gitcode.com/openharmony-sig/rntpc_react-native-blurhash).**
>
---
>
# Blurhash
> 🖼️ Give your users the loading experience they want.
Install via [npm](https://www.npmjs.com/package/react-native-blurhash):
```sh
npm i react-native-blurhash
npx pod-install
```
[](https://www.npmjs.com/package/react-native-blurhash)
[](https://www.npmjs.com/package/react-native-blurhash)
[](https://github.com/mrousavy?tab=followers)
[](https://twitter.com/mrousavy)
**BlurHash** is a compact representation of a placeholder for an image. Instead of displaying boring grey little boxes while your image loads, show a _blurred preview_ until the full image has been loaded.
> The algorithm was created by [woltapp/blurhash](https://github.com/woltapp/blurhash), which also includes an [algorithm explanation](https://github.com/woltapp/blurhash/blob/master/Algorithm.md).
Note: You can also use the react-native-blurhash encoder to encode straight from your React Native App! |
|
| Name | Type | Explanation | Required | Default Value |
|---|---|---|---|---|
blurhash |
string |
The blurhash string to use. Example: LGFFaXYk^6#M@-5c,1J5@[or[Q6. |
✅ | undefined |
decodeWidth |
number |
The width (resolution) to decode to. Higher values decrease performance, use 16 for large lists, otherwise you can increase it to 32.
See: performance |
❌ | 32 |
decodeHeight |
number |
The height (resolution) to decode to. Higher values decrease performance, use 16 for large lists, otherwise you can increase it to 32.
See: performance |
❌ | 32 |
decodePunch |
number |
Adjusts the contrast of the output image. Tweak it if you want a different look for your placeholders. | ❌ | 1.0 |
decodeAsync |
boolean |
Asynchronously decode the Blurhash on a background Thread instead of the UI-Thread.
See: Asynchronous Decoding |
❌ | false |
resizeMode |
'cover' | 'contain' | 'stretch' | 'center' |
Sets the resize mode of the image. (no, 'repeat' is not supported.)
See: Image::resizeMode |
❌ | 'cover' |
onLoadStart |
() => void |
A callback to call when the Blurhash started to decode the given blurhash string. |
❌ | undefined |
onLoadEnd |
() => void |
A callback to call when the Blurhash successfully decoded the given blurhash string and rendered the image to the <Blurhash> view. |
❌ | undefined |
onLoadError |
(message?: string) => void |
A callback to call when the Blurhash failed to load. Use the message parameter to get the error message. |
❌ | undefined |
All View props |
ViewProps |
All properties from the React Native View. Use style.width and style.height for display-sizes. Also, style.borderRadius is natively supported on iOS. |
❌ | {} |
| iOS Screenshot | Android Screenshot |
|---|---|
![]() |
![]() |