@optimuss-io/react-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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

Package Sidebar

Install

npm i @optimuss-io/react-sdk

Homepage

optimuss.io

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

41.4 kB

Total Files

10

Last publish

Collaborators

  • deepak.windo
  • theumbrella