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-facebook-ui

v1.1.0

Published

An NPM package that offers a suite of UI components inspired by Facebook User Interface.

Downloads

12

Readme

An NPM package that offers a suite of UI components inspired by Facebook User Interface.

i'm currently looking for a job

This UI package is one of my Must Create projects , i spent a couple of months to achieve this and i'm currently in a need for a software development job. and i'm ready to be recruited.

Please contact me via:

  • My Portfolio
  • My LinkedIn

Thank you.

react-facebook-ui NPM version NPM downloads

You're using React or NextJs , and want to build a production ready app faster ? you're in the right place , inspired by the facebook user interface, react-facebook-ui offers a suite of UI components and functionalities to help you ship new features faster.

react-facebook-ui is light weight , fast and extremely easy to use and customize.


Features

  • +30 Powerful UI components (Form , Data-Table , Modal , Sidebar , Toast , Menu ... and much more).
  • Standalone , No dependency required.
  • Lightweight , less than ~600kb.
  • Built-in theme customization.
  • Light & Dark theme out of the box.
  • RTL Support.
  • Responsive.
  • NextJs support.
  • helper functions (custom useful react hooks, make easy HTTP reaquests, generate fake data ...).

Demo & Playground

Installation

react-facebook-ui is available as an npm package.

npm install react-facebook-ui

Usage Example

Here is an example of a basic app using <Button/> component from react-facebook-ui:

import React from "react";
import {Button} from "react-facebook-ui";
export default function App() {
    return  <Button color="primary">Hello World!</Button>
}

Documentation

Bellow is react-facebook-ui documentation , it contains all the components , hooks , and helper functions explained with examples , so you can use react-facebook-ui properly.

Getting started with React Facebook UI

After installing the react-facebook-ui package on a fresh react project :

if you are using NextJS , see NextJs implimentation

  1. Create a react component <AppWrapper/> in your src/ directory with name AppWrapper.js
  2. Wrap children prop with the <MainLayout /> component
  3. On your src/index.js file , wrap you <App/> component with <AppWrapper/>.
  4. Done

it should look something like this:

src/AppWrapper.js

import React from "react";
import {MainLayout} from "react-facebook-ui";

export default function AppWrapper({children}) {
    // TODO :: configure your app here

    return  <MainLayout defaultAppdata={{theme:'dark'}}>
        {children}
    </MainLayout>
}

src/index.js

import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import AppWrapper from "./AppWrapper";

const root = ReactDOM.createRoot(document.getElementById('root'));

root.render(
  <React.StrictMode>
      <AppWrapper>
          <App />
      </AppWrapper>
  </React.StrictMode>
);

NOW you're ready to use the beauty of react-facebook-ui

NextJs implimentation

After installing the react-facebook-ui package on a fresh NextJs project :

  1. Open the layout wrapper file In your src/pages/_app.js
  2. Wrap the <Component {...pageProps}/> component with the <MainLayout /> component, it should look something like this:

src/pages/_app.js

import '../styles/globals.css'
import React from 'react';
import {MainLayout} from "react-facebook-ui";

function MyApp({ Component, pageProps }) {
  return  <MainLayout defaultAppdata={{theme:'dark'}}>
      <Component {...pageProps} />
    </MainLayout>
}
export default MyApp
  1. Almost Done, as we know since some of react-facebook-ui components such as <ButtonIcon/> depends on SVG icons but NextJs webpack doesn’t have a loader set up to handle the svg file type (.svg files). to fix that we'll use the @svgr/webpack:
  • install: npm install --save-dev @svgr/webpack
  • create/edit next.config.js file with the content bellow:
module.exports = {
    webpack(config) {
        config.module.rules.push({
            test: /\.svg$/i,
            issuer: /\.[jt]sx?$/,
            use: ['@svgr/webpack'],
        });
        return config
    },
};
  • importing SVGs on NextJs like this:
import React from "react";
import {ButtonIcon} from "react-facebook-ui";
import SearchIcon from "../assets/icons/search.svg";

export default function App() {
    return <ButtonIcon icon={<SearchIcon/>}/>
}
  1. Done.

NOW you're ready to use the beauty of react-facebook-ui for NextJs