Skeleton Loader For Iframe – React Loading Iframe

Description:

The React Loading Iframe component that shows a skeleton loader in an iframe element until the src page responds.

How to use it:

1. Install and import the component.

# Yarn
$ yarn add react-loading-iframe
# NPM
$ npm i react-loading-iframe
import LoadingIframe from 'react-loading-iframe';

2. Add an iframe into your app using the LoadingIframe instead.

const Skeleton = () => {
  return <div>Loading Screen</div>;
};
export const BasicExample = () => {
  return (
    <LoadingIframe
      skeleton={<Skeleton />}
      src="https://google.com"
      className="your-class"
      frameBorder={0}
    />
  );
};

Preview:

Skeleton Loader For Iframe - React Loading Iframe

Add Comment