<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Youcef Hammadi</title>
    <description>The latest articles on DEV Community by Youcef Hammadi (@ucfx).</description>
    <link>https://dev.to/ucfx</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2982673%2F9690cee6-5ee6-4f28-b6f0-09140a55e118.jpg</url>
      <title>DEV Community: Youcef Hammadi</title>
      <link>https://dev.to/ucfx</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ucfx"/>
    <language>en</language>
    <item>
      <title>Create PERT Charts Easily in React with react-pert</title>
      <dc:creator>Youcef Hammadi</dc:creator>
      <pubDate>Thu, 27 Mar 2025 17:45:31 +0000</pubDate>
      <link>https://dev.to/ucfx/create-pert-charts-easily-in-react-with-react-pert-4f3a</link>
      <guid>https://dev.to/ucfx/create-pert-charts-easily-in-react-with-react-pert-4f3a</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Create PERT Charts Easily in React with react-pert
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;PERT (Program Evaluation and Review Technique)&lt;/strong&gt; is a powerful method for project scheduling and task dependency visualization. I created &lt;code&gt;react-pert&lt;/code&gt; from scratch to provide an easy way to implement PERT diagrams in React applications! 🎯&lt;/p&gt;

&lt;p&gt;This open-source library lets you create, customize, and interact with PERT charts effortlessly.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;✅ Interactive PERT diagram rendering&lt;/li&gt;
&lt;li&gt;✅ Task dependencies &amp;amp; critical path calculation&lt;/li&gt;
&lt;li&gt;✅ Customizable styles &amp;amp; layout&lt;/li&gt;
&lt;li&gt;✅ Easy integration with React hooks&lt;/li&gt;
&lt;li&gt;✅ Open-source and developer-friendly&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📦 Installation
&lt;/h3&gt;

&lt;p&gt;To get started, install react-pert using npm or yarn:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install react-pert
# or
yarn add react-pert
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🚀 Getting Started
&lt;/h3&gt;

&lt;p&gt;1️⃣ Import &amp;amp; Setup the Provider&lt;/p&gt;

&lt;p&gt;Wrap your app with PertProvider to manage the PERT chart state.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { PertProvider } from "react-pert";

const App = () =&amp;gt; {
  return (
    &amp;lt;PertProvider&amp;gt;
      &amp;lt;MyPERTChart /&amp;gt;
    &amp;lt;/PertProvider&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2️⃣ Define Tasks &amp;amp; Render the PERT Chart&lt;br&gt;
Create an array of tasks with dependencies and durations, then render &lt;code&gt;Pert&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Pert, type TaskInput } from "react-pert";

const tasks: TaskInput[] = [
  { key: "1", duration: 5, text: "A" },
  { key: "2", duration: 4, text: "B" },
  { key: "3", duration: 2, text: "C", dependsOn: ["1"] },
  { key: "4", duration: 3, text: "D", dependsOn: ["2", "3"] },
];

const MyPERTChart = () =&amp;gt; {
  return &amp;lt;Pert tasks={tasks} /&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  🎉 Congratulations!
&lt;/h4&gt;

&lt;p&gt;You've successfully created a PERT chart!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsqraexq6dmjbe8v0ue0r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsqraexq6dmjbe8v0ue0r.jpg" alt="Pert Chart" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🖌️ Customizing Styles
&lt;/h3&gt;

&lt;p&gt;You can use the online demo to customize the style: &lt;a href="https://react-pert.ucef.dev/" rel="noopener noreferrer"&gt;react-pert demo&lt;/a&gt; easily and copy the styles from it.&lt;/p&gt;

&lt;p&gt;Add the styles to your code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const styles: PertStyles = {
  disableGrid: false,
  taskSize: 170,
  fontFamily: "system-ui",
  fontSize: "lg",
  textColor: "#000000",
  chartBackground: "#ffffff00",
  taskBackground: "#59ff7f",
  gridColor: "#83838350",
  borderWidth: 1,
  selectedBorderWidth: 3,
  hoverBorderWidth: 2,
  borderColor: "#000000",
  selectedBorderColor: "#6868ff",
  criticalColor: "#f8653c",
  arrowColor: "#615f77",
  arrowWidth: 2,
  gap: {
    x: 120,
    y: 290,
  },
};

function MyPERTChart() {
  return &amp;lt;Pert tasks={tasks} styles={styles} /&amp;gt;;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61p4dh9z3nw3xwardfv5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F61p4dh9z3nw3xwardfv5.png" alt="Chart after change styles" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Read the &lt;a href="https://github.com/ucfx/react-pert" rel="noopener noreferrer"&gt;docs&lt;/a&gt; for more details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  📌 Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;react-pert&lt;/code&gt; makes it effortless to create interactive and customizable PERT charts in React. Whether you're managing complex workflows or just need a visual project planner, this library has you covered. 🙌&lt;/p&gt;

&lt;p&gt;💡 Check it out on npm: &lt;a href="https://www.npmjs.com/package/react-pert" rel="noopener noreferrer"&gt;react-pert&lt;/a&gt;&lt;br&gt;
🛠️ Try the Online Demo: &lt;a href="https://react-pert.ucef.dev/" rel="noopener noreferrer"&gt;react-pert demo&lt;/a&gt;&lt;br&gt;
⭐ Star the project on GitHub: &lt;a href="https://github.com/ucfx/react-pert" rel="noopener noreferrer"&gt;react-pert repo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💬 What do you think? Let me know in the comments! 😊&lt;/p&gt;

</description>
      <category>pertchart</category>
      <category>react</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
