0.0.5 • Published 11 months ago

@optimuss-io/react-sdk v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

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

PropTypeDescription
domainstring?The domain of your Optimuss account.
mobileboolean?Whether to optimize images for mobile.
tabletboolean?Whether to optimize images for tablet
variantstring?The variant of image you created in optimuss.
webpboolean?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