An open API service indexing awesome lists of open source software.

https://github.com/dehbmarques/reimgix

:city_sunrise: Get all the benefits of Imgix using React. Supports LQIP.
https://github.com/dehbmarques/reimgix

imgix react-component render-prop

Last synced: about 1 year ago
JSON representation

:city_sunrise: Get all the benefits of Imgix using React. Supports LQIP.

Awesome Lists containing this project

README

          

![reimgix](./logo.png)

[![npm](https://img.shields.io/npm/v/reimgix.svg?style=flat-square)](https://www.npmjs.com/package/reimgix)
[![npm](https://img.shields.io/npm/dt/reimgix.svg?style=flat-square)](https://www.npmjs.com/package/reimgix)
[![GitHub issues](https://img.shields.io/github/issues/one-market/reimgix.svg?style=flat-square)](https://github.com/one-market/reimgix/issues)
[![GitHub stars](https://img.shields.io/github/stars/one-market/reimgix.svg?style=flat-square)](https://github.com/one-market/reimgix/stargazers)
[![Twitter](https://img.shields.io/twitter/url/https/github.com/one-market/reimgix.svg?style=social&style=flat-square)](https://twitter.com/intent/tweet?url=https://github.com/one-market/reimgix)

:city_sunrise: React utils to [imgix™](https://www.imgix.com/)

# Usage

Generate a stringified url with params

```js
import { generate } from 'reimgix'

const url = generate('http://your.site/img.png?fit=clamp', { h: 50 })
// url = http://your.site/img.png?fit=clamp&h=50
```

```js
const url = generate(
'http://your.site/img.png?fit=clamp',
{ h: 50 },
{ removeUrlParams: true } // will remove fit=clamp
)
// url = http://your.site/img.png?h=50
```

Lqip techinique

```jsx
import { Lqip, generate } from 'reimgix'

const url = generate('http://your.site/bear.png?fit=clamp', { h: 50 })

const App = () => (

{({ src }) => (
Bear
)}

)
```

```jsx
import { Lqip, generate } from 'reimgix'

const url = generate('http://your.site/bear.png?fit=clamp', { h: 50 })

const App = () => (

{({ src, loaded }) => (


Image below is using {loaded ? 'full version' : 'lqip version'}
Bear

)}

)
```

# Install

### Node Module

```
yarn add reimgix

# or

npm i reimgix
```

### UMD library

```html

```

exposed as `Reimgix`

# Contribute

You can help improving this project by sending PRs and helping with issues.