@danielsaraldi/react-native-blur-view

中文文档
3.2.0发布于 2026/10/26MITTypeScriptCommonJS零依赖近 30 天下载 5.7万

A simple blur view in react native

原始使用文档
文档目录24 节
  1. Summary
  2. Installation
  3. Usage
  4. Using lists
  5. Using Modal
  6. Using ImageBackground
  7. Components
  8. BlurView
  9. BlurTarget
  10. VibrancyView
  11. Types
  12. Blur Types
  13. Effect Styles
  14. Migrate to 3.x
  15. Why This Change?
  16. Platform Differences
  17. Android
  18. iOS
  19. tvOS
  20. Expo
  21. TypeScript Support
  22. Others Libraries
  23. Contributing
  24. License

@danielsaraldi/react-native-blur-view 🌫️

A simple blur view in react native based on @react-native-community/blur.

Support the animation transitions with react-native-screens, react-native-reanimated, react-native-navigation and Modals 😁. This library supports Apple TV and Android TV! 📺

[!WARNING] Bottom tabs customized with the react-navigation/bottom-tabs and sticky header component aren't supported in Android. For more information, just click here!

GitHub package.json version Unpacked size NPM Downloads

[!NOTE] This package supports only new architecture.

React Native Blur View on iOS React Native Blur View on Android

Summary

Installation

npm install @danielsaraldi/react-native-blur-view
# or
yarn add @danielsaraldi/react-native-blur-view
# or
pnpm add @danielsaraldi/react-native-blur-view
# or
bun add @danielsaraldi/react-native-blur-view

Install native dependencies (iOS only):

cd ios && pod install && cd ..

Usage

import { useRef } from 'react';
import { ScrollView, StyleSheet, Text, View } from 'react-native';
import {
  BlurView,
  BlurTarget,
  VibrancyView,
} from '@danielsaraldi/react-native-blur-view';
// ...

export default function App() {
  const targetRef = useRef<View | null>(null);
  // ...

  return (
    <>
      <BlurView blurTarget={targetRef} style={styles.blurView}>
        <Text style={styles.text}>BlurView</Text>
      </BlurView>

      <VibrancyView style={styles.vibrancyView}>
        <Text style={styles.text}>VibrancyView</Text>
      </VibrancyView>

      <BlurTarget ref={targetRef} style={styles.blurTarget}>
        <ScrollView
          style={styles.scrollView}
          contentContainerStyle={styles.contentContainer}
          showsVerticalScrollIndicator={false}
        >
          {/* ... */}
        </ScrollView>
      </BlurTarget>
    </>
  );
}

export const styles = StyleSheet.create({
  blurView: {
    position: 'absolute',
    top: 0,

    width: '100%',
    height: 256,

    justifyContent: 'center',
    alignItems: 'center',
  },

  vibrancyView: {
    position: 'absolute',
    top: 256,

    width: '100%',
    height: 256,

    justifyContent: 'center',
    alignItems: 'center',
  },

  title: {
    fontSize: 24,
    fontWeight: 'bold',

    color: 'white',
  },

  main: {
    flex: 1,
  },

  content: {
    padding: 20,

    gap: 8,
  },
});

Using lists

You must add BlurView elements inside the list, and the content behind should be added as a child of the BlurTarget component. Check an example using ScrollView below:

import { useRef } from 'react';
import { ImageBackground, ScrollView, Text, View } from 'react-native';
import { BlurView, BlurTarget } from '@danielsaraldi/react-native-blur-view';
// ...

export function MyScreen() {
  const targetRef = useRef<View | null>(null);
  // ...

  return (
    <View style={styles.container}>
      <BlurTarget ref={targetRef} style={styles.blurTarget}>
        <ImageBackground
          style={styles.background}
          source={BACKGROUND}
          resizeMode="cover"
        />
      </BlurTarget>

      <ScrollView
        style={styles.scrollView}
        contentContainerStyle={styles.contentContainer}
        showsVerticalScrollIndicator={false}
      >
        <BlurView blurTarget={targetRef} style={styles.blurView}>
          <Text style={styles.text}>BlurView 1</Text>
        </BlurView>

        <BlurView blurTarget={targetRef} style={styles.blurView}>
          <Text style={styles.text}>BlurView 2</Text>
        </BlurView>

        <BlurView blurTarget={targetRef} style={styles.blurView}>
          <Text style={styles.text}>BlurView 3</Text>
        </BlurView>

        {/* ... */}
      </ScrollView>
    </View>
  );
}

Using Modal

You must add BlurTarget as a parent of the content screen because it will be the target of blur. The BlurView component must be used inside Modal for the blur effect to work correctly.

import { useRef, useState } from 'react';
import { Modal, View } from 'react-native';
import { BlurTarget, BlurView } from '@danielsaraldi/react-native-blur-view';
// ...

export function MyScreen() {
  const [isOpenModal, setIsOpenModal] = useState<boolean>(false);
  const targetRef = useRef<View | null>(null);
  // ...

  return (
    <>
      <Modal
        transparent
        statusBarTranslucent
        navigationBarTranslucent
        hardwareAccelerated
        visible={isOpenModal}
        onRequestClose={() => setIsOpenModal(false)}
        style={styles.modal}
      >
        <BlurView blurTarget={targetRef} style={styles.blurView} />

        <View style={styles.modalContent}>{/* ... */}</View>
      </Modal>

      <BlurTarget ref={targetRef} style={styles.blurTarget}>
        {/* ... */}
      </BlurTarget>
    </>
  );
}

Using ImageBackground

You must add BlurTarget as a parent of ImageBackground because it will be the target of blur. The BlurView component must be used as a sibling of BlurTarget for the blur effect to work correctly.

import { useRef } from 'react';
import { ImageBackground, View } from 'react-native';
import { BlurTarget, BlurView } from '@danielsaraldi/react-native-blur-view';
// ...

export function MyScreen() {
  const targetRef = useRef<View | null>(null);
  // ...

  return (
    <>
      <View style={styles.blurViewWrapper}>
        <BlurView
          blurTarget={targetRef}
          style={styles.blurView}
          downscaleFactor={4}
        >
          {/** ... **/}
        </BlurView>
      </View>

      <BlurTarget ref={targetRef} style={styles.blurTarget}>
        <ImageBackground
          style={styles.background}
          source={{ uri: 'https://picsum.photos/seed/picsum/600/900' }}
          resizeMode="cover"
        />
      </BlurTarget>
    </>
  );
}

Components

BlurView

The BlurView component extends the same properties of a View component. The blurTarget prop is required for the Android blur effect to work correctly.

Properties

PropertyDescriptionDefaultPlatform
blurTargetRef of the BlurTarget component to be identified by the BlurView component in the tree.undefinedAndroid
typeBlur type of the overlay.lightAll
radiusBlur radius 0 - 100.20.0All
downscaleFactorDownscale factor 0 - 100.6.0Android
overlayColorAdd the overlay color to the component.undefinedAll
androidColorOverrides the type property color.undefinedAndroid
reducedTransparencyFallbackColorBackground color for the blur effect when reduced transparency is enabled.whiteiOS

When a value less than 0 or greater than 100 is provided for the radius or downscaleFactor property, the value is clipped.

BlurTarget

The BlurTarget component extends the same properties of a View component.

This component is available for Android only. It's useful because we use Dimezis's 3v library to apply the blur effect, so its implementation is slightly different than on iOS. The BlurTarget component is a common View in iOS.

The BlurTarget may not contain a BlurView that targets the same BlurTarget. The BlurTarget may contain other BlurTargets and BlurViews though.

Properties

PropertyDescriptionDefaultPlatform
refRef of the BlurTarget component to be identified by the BlurView component in the tree.undefinedAndroid

VibrancyView

The VibrancyView component extends the same properties of a View component.

This component is available for iOS only. It applies a vibrancy effect to child content. On Android, the VibrancyView component is a common View. The effectStyle property isn't supported on tvOS.

Properties

PropertyDescriptionDefaultPlatform
typeBlur type of the overlay.lightiOS
effectStyleEffect style to vibrancy content.labeliOS
radiusBlur radius 0 - 100.20.0iOS
overlayColorAdd the overlay color to the component.undefinediOS
reducedTransparencyFallbackColorBackground color for the vibrancy effect when reduced transparency is enabled.whiteiOS

When a value less than 0 or greater than 100 is provided for the radius property, the radius is clipped.

Types

These are all available types.

Blur Types

On iOS, all types are supported, but on Android, the types are simulated using RGBA colors.

PropertyDescriptionPlatform
extra-lightThe area of the view is lighter than the underlying view.All
lightThe area of the view is the same approximate lightness of the underlying view.All
darkThe area of the view is darker than the underlying view.All
extra-darkThe area of the view is even more dark than the underlying view. (tvOS >= 10)All
regularA regular blur style that adapts to the user interface style. (iOS >= 10)All
prominentA blur style for making content more prominent that adapts to the user interface style. (iOS >= 10)All
chrome-materialAn adaptable blur effect that creates the appearance of the system chrome. (iOS >= 13)All
materialAn adaptable blur effect that creates the appearance of a material with normal thickness. (iOS >= 13)All
thick-materialAn adaptable blur effect that creates the appearance of a material that’s thicker than normal. (iOS >= 13)All
thin-materialAn adaptable blur effect that creates the appearance of a thin material. (iOS >= 13)All
ultra-thin-materialAn adaptable blur effect that creates the appearance of an ultra-thin material. (iOS >= 13)All
chrome-material-lightA blur effect that creates the appearance of the system chrome and is always light. (iOS >= 13)All
material-lightA blur effect that creates the appearance of a material with normal thickness and is always light. (iOS >= 13)All
thick-material-lightA blur effect that creates the appearance of a material that’s thicker than normal and is always light. (iOS >= 13)All
thin-material-lightA blur effect that creates the appearance of a thin material and is always light. (iOS >= 13)All
ultra-thin-material-lightA blur effect that creates the appearance of an ultra-thin material and is always light. (iOS >= 13)All
chrome-material-darkA blur effect that creates the appearance of the system chrome and is always dark. (iOS >= 13)All
material-darkA blur effect that creates the appearance of a material with normal thickness and is always dark. (iOS >= 13)All
thick-material-darkA blur effect that creates the appearance of a material that’s thicker than normal and is always dark. (iOS >= 13)All
thin-material-darkA blur effect that creates the appearance of a thin material and is always dark. (iOS >= 13)All
ultra-thin-material-darkA blur effect that creates the appearance of an ultra-thin material and is always dark. (iOS >= 13)All

Learn more about blur types here.

Effect Styles

On iOS, all effect styles are supported. This property is available in the VibrancyView component, it's iOS only.

PropertyDescriptionPlatform
labelA style for labels containing primary content. (iOS >= 13)iOS
secondary-labelA style for labels containing secondary content. (iOS >= 13)iOS
tertiary-labelA style for labels containing tertiary content. (iOS >= 13)iOS
quaternary-labelA style for labels containing quaternary content. (iOS >= 13)iOS
fillA style for views with large filled areas containing primary content. (iOS >= 13)iOS
secondary-fillA style for views with large filled areas containing secondary content. (iOS >= 13)iOS
tertiary-fillA style for views with large filled areas containing tertiary content. (iOS >= 13)iOS
separatorA style for separator lines. (iOS >= 13)iOS
  • Label styles show progressive opacity drops from full white to near-invisible.
  • Fill styles show translucent rectangles at decreasing opacity levels.
  • Separator style is specifically for thin, translucent separator lines.

Learn more about effect styles here.

Migrate to 3.x

[!WARNING] Version 3.0.0 introduces significant API changes on Android and iOS applications. If you're upgrading from 2.x, please read this section carefully.

In version 3.0.0, the x-light blur type has been renamed to extra-light in the BlurView and VibrancyView components:

// ❌ Old API (v2.x) - Deprecated
<BlurView blurTarget={targetRef} type='x-light' style={styles.blurView}>
  {/** ... **/}
</BlurView>

<VibrancyView blurTarget={targetRef} type='x-light' style={styles.vibrancyView}>
  {/** ... **/}
</VibrancyView>

// ✅ New API (v3.0.0) - Current
<BlurView blurTarget={targetRef} type='extra-light' style={styles.blurView}>
  {/** ... **/}
</BlurView>

<VibrancyView blurTarget={targetRef} type='extra-light' style={styles.vibrancyView}>
  {/** ... **/}
</VibrancyView>

A new type of blur called extra-dark has been added to the BlurView and VibrancyView components. Below is a small example:

// ✅ New type (v3.0.0) - Current
<BlurView blurTarget={targetRef} type="extra-dark" style={styles.blurView}>
  {/** ... **/}
</BlurView>

Why This Change?

This version focused exclusively on full TV device support. The main changes are listed below:

  • New support: Added full support for Android TV and Apple TV.
  • Types: The BlurView and VibrancyView component types have undergone minor changes:
    • Renaming: Renamed x-light to extra-light.
    • New type: Added a new extra-dark type.
  • Runtime: Bump Node.js version from 20.x to 22.x.

Platform Differences

Android

On Android platforms, the component utilizes the BlurView library to offer native blur effects with hardware-accelerated rendering.

For regular, prominent, and material blur types, the overlay color opacity is scaled by radius / 100 to match the iOS effect intensity. This doesn't apply when androidColor is provided.

The androidColor property can be useful when you want to achieve a specific look or match the blur effect to other elements in your app. It overrides the type property.

Bottom tabs customized with the react-navigation/bottom-tabs and sticky header component aren't supported! If you want to customize your bottom tabs or sticky header component, opt for @sbaiahmed1/react-native-blur.

Only components based on TextureView are supported. Components that use SurfaceView aren't supported by the BlurView third-party library.

iOS

On iOS, all types are supported by default. However, on Android they are RGBA colors to simulate the same blur color.

The extra-dark blur type is not natively available on iOS, so it falls back to the dark blur type.

For regular, prominent, and material blur types, the radius property controls the strength of the whole effect (blur, tint, and saturation) as a percentage (radius / 100), since these types don't support a custom blur radius. A radius of 100 keeps the native strength of the blur type, which can't be exceeded.

tvOS

On tvOS, the blur types extra-light, light, dark, extra-dark, regular, and prominent are supported. Other blur types are accepted by the API but fall back to the light blur type on tvOS, since the underlying UIBlurEffectStyle values are unavailable.

The effect styles aren't supported.

Expo

In Expo, you need to convert to a custom development build or use prebuild. You can also use React Native without Expo.

TypeScript Support

Full TypeScript support with proper type definitions!

import {
  BlurType,
  EffectStyle,
  BlurViewProps,
  BlurTargetProps,
  VibrancyProps,
} from '@danielsaraldi/react-native-blur-view';

export const INITIAL_BLUR_TYPE: BlurType = 'light';
export const INITIAL_EFFECT_STYLE: EffectStyle = 'label';

export interface CustomBlurViewProps extends BlurViewProps {
  // ...
}

export interface CustomBlurTargetProps extends BlurTargetProps {
  // ...
}

export interface CustomVibrancyViewProps extends VibrancyProps {
  // ...
}

Others Libraries

  • ✅ expo-blur - A React component that blurs everything underneath the view. Common usage of this is for navigation bars, tab bars, and modals.
  • ✅ @sbaiahmed1/react-native-blur - A modern React Native blur view component that provides native blur effects for both iOS and Android platforms. Also adds progressive blur and liquid glass.
  • 🛑 @react-native-community/blur - A component for UIVisualEffectView's blur and vibrancy effect on iOS, and BlurView on Android.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library ❤️

版本与发布记录

@danielsaraldi/react-native-blur-view 共发布 57 个版本,首次发布于 2025/06/17;过去 12 个月发布了 29 个版本。

版本发布日期距今
3.2.0latest2026/10/2615 天前
3.1.12026/10/1823 天前
3.1.02026/10/1427 天前
3.0.52026/10/031 个月前
3.0.42026/10/031 个月前
3.0.32026/09/052 个月前

关于 @danielsaraldi/react-native-blur-view 的常见问题

@danielsaraldi/react-native-blur-view 是什么?

A simple blur view in react native

如何安装 @danielsaraldi/react-native-blur-view?

在项目目录运行 npm install @danielsaraldi/react-native-blur-view,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、react-native(*)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@danielsaraldi/react-native-blur-view 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@danielsaraldi/react-native-blur-view 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@danielsaraldi/react-native-blur-view 可以商用吗?

@danielsaraldi/react-native-blur-view 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@danielsaraldi/react-native-blur-view 的下载量有多少?

根据 npm 官方下载统计,@danielsaraldi/react-native-blur-view 在 2026/10/12 – 2026/11/10 这 30 天内被下载 56,783 次,日均约 1,893 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@danielsaraldi/react-native-blur-view 还在维护吗?

最新版本 3.2.0 发布于 2026/10/26(15 天前);至今共发布 57 个版本,其中过去 12 个月发布了 29 个;首次发布于 2025/06/17。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。