@optimuss-io/react-sdk
v0.0.5
Published
Optimuss React SDK
Downloads
1
Readme
Optimuss React SDK
This is the official Optimuss React SDK. It provides a set of React components that simplifies usage of images in your React project.
Installation
npm install @optimuss-io/react-sdk
OR
yarn add @optimuss-io/react-sdk
Usage
import React from 'react';
import {Image, OptimussProvider} from '@optimuss-io/react-sdk';
function SampleComponent() {
return (
<div>
<OptimussProvider
domain={"example"}
mobile={true}
tablet={true}
variant={"default"}
webp={true}
>
<Image
src={"products/eample.png"}
/>
</OptimussProvider>
</div>
)
}
Props
OptimussProvider
| Prop | Type | Description | |---------|----------|-----------------------------------------------| | domain | string? | The domain of your Optimuss account. | | mobile | boolean? | Whether to optimize images for mobile. | | tablet | boolean? | Whether to optimize images for tablet | | variant | string? | The variant of image you created in optimuss. | | webp | boolean? | Whether to optimize images for webp. |
Image
All image element props are supported. You can override provider props by passing them to the Image component.
example:
<Image
src={"products/eample.png"}
mobile={false}
/>
Support
React >= 16.3.0
For more information, please visit Optimus Docs
Created by Optimuss