1.0.5 • Published 6 months ago

react-iphone-preview v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
6 months ago

React Iphone Preview Component

The React Iphone Preview is a simple component that lets you showcase content inside an IPhoneX illustration.

Installation

npm install react-iphone-preview
import { IphonePreview } from 'react-iphone-preview';

Usage

To use the IphonePreview component, simply render it in your JSX and provide the desired props:

<IphonePreview content={<YourContent />} />

Demo

Check out - CodeSandbox example

Props

1. content (Optional)

The content prop allows you to insert any content, such as react components, images or text, inside the iPhone's screen area.

  • Type: PropTypes.node
  • Default: null

2. overlayStyle (Optional)

The overlayStyle prop is an object that lets you pass additional inline styles to the overlay (the content area inside the iPhone's screen). This provides an easy way to customize the appearance of the content being displayed.

  • Type: PropTypes.object
  • Default: {}

Customizing Overlay Styles

To customize the styles of the overlay, you can leverage the overlayStyle prop:

<IphonePreview 
    content={"This is an Example"} 
    overlayStyle={{
        backgroundColor: 'rgba(255, 0, 0, 0.3)',  // Example: Setting a red background with 30% opacity
        // ... any other valid inline styles
    }} 
/>
1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago

0.1.6

6 months ago

0.1.5

7 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

7 months ago

0.1.1

7 months ago

0.1.0

7 months ago