|
1 | 1 | # react-native-fxblurview
|
2 |
| -react native ui component for controlled blur, based on popular FXBlurView library |
| 2 | +`<FXBlurView />` provides a [React Native][react-native] component wrapping the native [FXBlurView](https://github.com/nicklockwood/FXBlurView) UIView subclass for realtime background blur effect and is compatible with iOS 5 and above. |
3 | 3 |
|
4 |
| -https://github.com/nicklockwood/FXBlurView |
| 4 | +<img src="https://raw.githubusercontent.com/magus/react-native-fxblurview/master/example/preview.png" alt="preview" height="400" /> |
5 | 5 |
|
6 |
| -## install |
| 6 | +## Table of contents |
| 7 | +- [Setup](#setup) |
| 8 | +- [Usage](#usage) |
| 9 | +- [Example](#example) |
| 10 | +- [Contributing](#contributing) |
| 11 | +- [Copyright and license](#copyright-and-license) |
| 12 | + |
| 13 | + |
| 14 | +## Setup |
7 | 15 | `rnpm install react-native-fxblurview`
|
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +### FXBlurView |
| 20 | +Provides a React Native component which wraps the `FXBlurView`. |
| 21 | + |
| 22 | +##### Defaults |
| 23 | +```js |
| 24 | +import FXBlurView from 'react-native-fxblurview' |
| 25 | + |
| 26 | +class BlurredView extends Component { |
| 27 | + render() { |
| 28 | + return ( |
| 29 | + <FXBlurView> |
| 30 | + { this.props.children } |
| 31 | + </FXBlurView> |
| 32 | + ); |
| 33 | + } |
| 34 | +} |
| 35 | +``` |
| 36 | + |
| 37 | +##### Fields |
| 38 | + |
| 39 | +| Prop | Type | Opt/Required | Default | Note | |
| 40 | +|---|---|---|---|---| |
| 41 | +| `blurEnabled` | `bool` | Optional | true | Toggles blurring on and off for an individual FXBlurView instance |
| 42 | +| `blurRadius` | `number` | Optional | 40 | Radius of the blur effect (in points). Defaults to a 40 point radius, which is similar to the iOS 7 blur effect |
| 43 | +| `dynamic` | `bool` | Optional | false | Controls whether the FXBlurView updates dynamically, or only once when the view is added to its superview |
| 44 | + |
| 45 | + |
| 46 | +## Example |
| 47 | +```sh |
| 48 | +open example/FXBlurViewExample/ios/FXBlurViewExample.xcodeproj |
| 49 | +``` |
| 50 | + |
| 51 | +See the [example](example/FXBlurViewExample) project for a working example. |
| 52 | + |
| 53 | +## Contributing |
| 54 | +Just submit a pull request! |
| 55 | + |
| 56 | +### Contact |
| 57 | +[Twitter - @imnmj](http://twitter.com/imnmj) |
| 58 | + |
| 59 | +[iamnoah.com](http://iamnoah.com) |
| 60 | + |
| 61 | +## Copyright and license |
| 62 | + |
| 63 | +Code and documentation copyright 2016 Noah. Code released under [the MIT license](https://github.com/magus/react-native-fxblurview/blob/master/LICENSE). |
0 commit comments