π react-fake-data
β Generate Realistic Fake Data for Your React Apps!
Hey Devs! π
Have you ever needed realistic fake data for your React project? Maybe for testing UI components, prototyping dashboards, or mock user profiles? Well, Iβve got something for you! π₯
Introducing react-fake-data
β a lightweight and powerful NPM package that helps you generate fake users, posts, and more effortlessly! π
β¨ Features:
β
Easy-to-use hooks β useFakeUser()
, useFakePosts()
β
Ready-to-use FakeProfile
component
β
Zero dependencies (only faker-js
)
β
Perfect for UI Testing & Mocking Data
π¦ Installation
Get started by installing it in your React project:
npm install react-fake-data
or
yarn add react-fake-data
π₯ Usage Example
π 1. Generate Fake User Data
import React from "react";
import { useFakeUser } from "react-fake-data";
const App = () => {
const user = useFakeUser();
return (
<div>
<h1>Fake User Profile</h1>
<p>Name: {user.name}</p>
<p>Email: {user.email}</p>
<p>Location: {user.location}</p>
</div>
);
};
export default App;
πΌ 2. Use the Ready-to-Go FakeProfile
Component
import React from "react";
import { FakeProfile } from "react-fake-data";
const App = () => (
<div>
<h1>Fake Profile Component</h1>
<FakeProfile />
</div>
);
export default App;
β Boom! π Now you have instant, dynamic fake data in your app!
π Try It Now!
π NPM Package: react-fake-data
π GitHub: [https://github.com/mahmud-r-farhan]
π₯ Give it a β on GitHub if you find it useful!
π¬ Have feedback? Let me know in the comments!
Let's Connect!
π» Github
π¦ Twitter: [https://x.com/mahmud_r_farhan]
π§ Email: dev@devplus.fun
π Happy Coding! ππ₯
-> Follow for more!
Top comments (0)