npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-framify

v2.0.2

Published

A React component library for device framesets

Downloads

82

Readme

React-Framify

GitHub Badge LinkedIn Badge Twitter Badge Website Badge

Introduction

React-Framify is a powerful library that allows you to showcase your app screenshots within realistic device frames. Whether you're presenting mobile or tablet designs, React-Framify makes it easy. Check out the official React-Framify GitHub repository for more details.

Supported React.js

React-Framify supports React.js 18.2.0 and above.

Supported Device Framesets

React-Framify supports the following devices:

  • iPhone 14 Pro/15/15 Pro: These devices feature dynamic island displays.
  • iPad Pro: Showcase your tablet designs with precision.
  • Google Pixel 8/9/9 Pro: Android users, we've got you covered too!

Installation

To install React-Framify, simply run:

npm install react-framify

Version 2.0.0 is the major release after our beta launch, and we encourage you to stick with it. If you have an older version installed, make sure to update to the latest.

Usage

Importing Components

You can import the following components from React-Framify:

import { IPhoneFrame, AndroidFrame, IPadFrame } from "react-framify";

Props

IPhoneFrame, AndroidFrame, and IPadFrame

These components accept the following props:

  • screenshotList: An array of screenshot URLs (required).
  • statusBar: Specify the status bar mode (light or dark) (required).
  • deviceColor: Customize the device frame color (optional).
  • orientation: Set to "portrait" or "landscape" (optional) - Default: "portrait".
  • buttonStyles: Customize button styles (optional).

buttonStyles

  • backgroundColor: string (optional) - Default: '#004F98'
  • color: string (optional) - Default: '#FFF'
  • border: string (optional) - Default: 'none'
  • borderRadius: string (optional) - Default: '16px'
  • fontSize: string (optional) - Default: '16px'
  • fontFamily: string (optional) - Default: 'Verdana, Geneva, Tahoma, sans-serif'
  • fontWeight: string (optional) - Default: '700'
  • padding: string (optional) - Default: '8px 16px'

Here's an example using AndroidFrame:

<AndroidFrame
  screenshotList={screenshotList}
  deviceColor="#A6A6A6"
  orientation="portrait"
  statusBar={{ mode: "light" }}
  buttonStyles={{
    backgroundColor: "#1DCDFE",
  }}
/>

Using with Next.js

If you're incorporating React-Framify into a Next.js project, you'll need to handle images a bit differently due to Next.js's image optimization features. Here's how you can do it:

"use client"

// Import your images as StaticImageData
import FrameSetSSOne from "../../../public/img-1.png";
import FrameSetSSTwo from "../../../public/img-2.png";
import FrameSetSSThree from "../../../public/img-3.png";
import FrameSetSSFour from "../../../public/img-4.png";

export default function MyApp() {
  // Use the .src attribute of imported images for the screenshotList
  const screenshotList = [
    FrameSetSSOne.src,
    FrameSetSSTwo.src,
    FrameSetSSThree.src,
    FrameSetSSFour.src
  ];

  return (
    <>
      <AndroidFrame
        screenshotList={screenshotList}
        deviceColor="#A6A6A6"
        orientation="portrait"
        statusBar={{ mode: "light" }}
        buttonStyles={{
          backgroundColor: "#1DCDFE",
        }}
      />
    </>
  )
}

Feel free to explore additional customization options for buttonStyles.

Implementing Screenshots

Showcasing screenshots in a normal React.js project versus a Next.js project is straightforward. If you're using Next.js, handle images as StaticImageData for optimal performance.

Preview

Check out the YouTube showcase for a visual preview of React-Framify in action.

Preview 1 Preview 2

License and Optional Support

React-Framify is open-source and available under the GNU General Public License v3.0.For information on how to contribute, please see our Contributing Guidelines. If you find our library useful, consider supporting Hatem Soliman via PayPal.

Join the Journey

Join us on this exciting journey to make React-Framify the go-to library for all your app presentation needs. Your feedback and contributions are what make this project thrive. Let's create something amazing together!


Feel free to adapt and expand upon this documentation as needed. Happy framing! 📱🚀


Launch on Product Hunt 🚀

We're excited to announce that React-Framify is now live on Product Hunt! If you love our library and want to support us, please check out our Product Hunt page. Your upvotes and feedback are greatly appreciated!

Product Hunt Badge

Product Preview

Here are a few sneak peeks at what you can do with React-Framify:

Preview 1 Preview 2