<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Siddharth Vishvanath on Medium]]></title>
        <description><![CDATA[Stories by Siddharth Vishvanath on Medium]]></description>
        <link>https://medium.com/@sidddude92?source=rss-6bb159c23af6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*eYxZcN4TA22k0C3e.</url>
            <title>Stories by Siddharth Vishvanath on Medium</title>
            <link>https://medium.com/@sidddude92?source=rss-6bb159c23af6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:07:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sidddude92/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Prime React — An Awesome React UI library.]]></title>
            <link>https://medium.com/@sidddude92/prime-react-an-awesome-react-ui-library-6ba3195d5b3c?source=rss-6bb159c23af6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ba3195d5b3c</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[glassmorphism]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Siddharth Vishvanath]]></dc:creator>
            <pubDate>Thu, 16 Sep 2021 13:20:32 GMT</pubDate>
            <atom:updated>2021-09-16T13:20:32.464Z</atom:updated>
            <content:encoded><![CDATA[<h3>Prime React — An Awesome React UI library.</h3><figure><img alt="Prime React Logo" src="https://cdn-images-1.medium.com/max/1024/1*aT7oVaUntkAQpWXTfkuKyA.png" /></figure><h3>Introduction</h3><p><a href="https://primefaces.org/primereact/showcase/#/setup">Prime React</a> is an awesome library where there are tons of components that are really helpful when creating enterprise grade production software. I have worked with this library in many projects and I want to share about its amazing features and how its really super easy to integrate with our plain react app.</p><h3>Setup</h3><p>First let’s create a react app</p><pre>npx create-react-app</pre><p>Once you app is ready.</p><pre>npm install primereact primeicons primeflex react-transition-group</pre><p>Navigate to your index.js file and the following at the top of the file</p><pre>import &quot;primereact/resources/themes/saga-blue/theme.css&quot;; <br>import &quot;primereact/resources/primereact.min.css&quot;; <br>import &quot;primeicons/primeicons.css&quot;;<br>import &#39;primeflex/primeflex.css&#39;;</pre><p>Once you add your styles now lets edit the App.js file and see whether the components have loaded properly.</p><pre>import React, { useState } from &quot;react&quot;;</pre><pre>import { Menubar } from &quot;primereact/menubar&quot;;</pre><pre>import { Card } from &quot;primereact/card&quot;;</pre><pre>function App() {</pre><pre>// eslint-disable-next-line</pre><pre>const [items, setitems] = useState([</pre><pre>{</pre><pre>label: &quot;File&quot;,</pre><pre>icon: &quot;pi pi-fw pi-file&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-plus&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Bookmark&quot;,</pre><pre>icon: &quot;pi pi-fw pi-bookmark&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Video&quot;,</pre><pre>icon: &quot;pi pi-fw pi-video&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-trash&quot;,</pre><pre>},</pre><pre>{</pre><pre>separator: true,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Export&quot;,</pre><pre>icon: &quot;pi pi-fw pi-external-link&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Left&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-left&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Right&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-right&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Center&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-center&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Justify&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-justify&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Users&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-minus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Search&quot;,</pre><pre>icon: &quot;pi pi-fw pi-users&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Filter&quot;,</pre><pre>icon: &quot;pi pi-fw pi-filter&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Print&quot;,</pre><pre>icon: &quot;pi pi-fw pi-print&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>icon: &quot;pi pi-fw pi-bars&quot;,</pre><pre>label: &quot;List&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Events&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Save&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Archieve&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-times&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Remove&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Quit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-power-off&quot;,</pre><pre>},</pre><pre>]);</pre><pre>return (</pre><pre>&lt;&gt;</pre><pre>&lt;Menubar model={items} /&gt;</pre><pre>&lt;div className=&quot;flex flex-row flex-wrap justify-content-between&quot;&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/&gt;</pre><pre>);</pre><pre>}</pre><pre>export default App;</pre><p>Once you run the app the output will be similar to below image,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DA8WsZDN0LhZ28nftfhlvw.png" /></figure><p>Now lets add a table below these cards.</p><pre>import React, { useState, useEffect } from &quot;react&quot;;</pre><pre>import { Menubar } from &quot;primereact/menubar&quot;;</pre><pre>import { Card } from &quot;primereact/card&quot;;</pre><pre>import { DataTable } from &quot;primereact/datatable&quot;;</pre><pre>import { Column } from &quot;primereact/column&quot;;</pre><pre>function App() {</pre><pre>const [products, setProducts] = useState([]);</pre><pre>// eslint-disable-next-line</pre><pre>const [items, setitems] = useState([</pre><pre>{</pre><pre>label: &quot;File&quot;,</pre><pre>icon: &quot;pi pi-fw pi-file&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-plus&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Bookmark&quot;,</pre><pre>icon: &quot;pi pi-fw pi-bookmark&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Video&quot;,</pre><pre>icon: &quot;pi pi-fw pi-video&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-trash&quot;,</pre><pre>},</pre><pre>{</pre><pre>separator: true,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Export&quot;,</pre><pre>icon: &quot;pi pi-fw pi-external-link&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Left&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-left&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Right&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-right&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Center&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-center&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Justify&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-justify&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Users&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-minus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Search&quot;,</pre><pre>icon: &quot;pi pi-fw pi-users&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Filter&quot;,</pre><pre>icon: &quot;pi pi-fw pi-filter&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Print&quot;,</pre><pre>icon: &quot;pi pi-fw pi-print&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>icon: &quot;pi pi-fw pi-bars&quot;,</pre><pre>label: &quot;List&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Events&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Save&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Archieve&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-times&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Remove&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Quit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-power-off&quot;,</pre><pre>},</pre><pre>]);</pre><pre>useEffect(() =&gt; {</pre><pre>fetch(&quot;https://jsonplaceholder.typicode.com/users&quot;)</pre><pre>.then((response) =&gt; response.json())</pre><pre>.then((data) =&gt; setProducts(data));</pre><pre>}, []);</pre><pre>return (</pre><pre>&lt;&gt;</pre><pre>&lt;Menubar model={items} /&gt;</pre><pre>&lt;div className=&quot;flex flex-row flex-wrap justify-content-between&quot;&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;Card</pre><pre>className=&quot;flex align-items-center justify-content-center w-20rem&quot;</pre><pre>title=&quot;Title&quot;</pre><pre>subTitle=&quot;SubTitle&quot;</pre><pre>&gt;</pre><pre>Content</pre><pre>&lt;/Card&gt;</pre><pre>&lt;DataTable value={products} paginator rows={5} showGridlines stripedRows&gt;</pre><pre>&lt;Column style={{ width: &quot;10px&quot; }} field=&quot;id&quot; header=&quot;ID&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;name&quot; header=&quot;Name&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;80px&quot; }} field=&quot;username&quot; header=&quot;Username&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;180px&quot; }} field=&quot;email&quot; header=&quot;Email&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;phone&quot; header=&quot;Phone&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;website&quot; header=&quot;Website&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;company.name&quot; header=&quot;Company Name&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;company.catchPhrase&quot; header=&quot;About&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;/DataTable&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;/&gt;</pre><pre>);</pre><pre>}</pre><pre>export default App;</pre><p>Once you add the table, you can see the output like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VwZMRCXeQnauYjIsxqjkmA.png" /></figure><p>Now lets style the page to have different cards to be of different statistics of the list of users we can view in the table.</p><p>Firstly let’s focus on the cards to have different colors, in order to make it unique to the data it shows. I am going to convert this card in one component we need and then dynamically apply the color using props.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*EhoWfKMExverXTo6xzO34A.png" /></figure><p>Create a components folder and under that create a SimpleCard.js file</p><p>I have added some styles to the App.css file,</p><pre>.customSuccessCard div.p-card {<br>background-image: linear-gradient(to right bottom, rgb(209, 250, 229), rgb(52, 211, 153), rgb(52, 211, 153));</pre><pre>}</pre><pre>.customDefaultCard div.p-card {</pre><pre>background-image: linear-gradient(to right bottom, rgb(248, 250, 252), rgb(148, 163, 184), rgb(148, 163, 184));</pre><pre>}</pre><pre>.customDangerCard div.p-card {</pre><pre>background-image: linear-gradient(to right bottom, rgb(254, 242, 242), rgb(248, 113, 113), rgb(248, 113, 113));</pre><pre>}</pre><pre>.customWarningCard div.p-card {</pre><pre>background-image: linear-gradient(to right bottom, rgb(255, 251, 235), rgb(252, 211, 77), rgb(251, 191, 36));</pre><pre>}</pre><p>I added this code inside the SimpleCard.js</p><pre>import React, { useState } from &quot;react&quot;;</pre><pre>import { Card } from &quot;primereact/card&quot;;</pre><pre>const CARD_TYPE = {</pre><pre>SUCCESS: &quot;customSuccessCard&quot;,</pre><pre>DANGER: &quot;customDangerCard&quot;,</pre><pre>WARN: &quot;customWarningCard&quot;,</pre><pre>DEFAULT: &quot;customDefaultCard&quot;,</pre><pre>};</pre><pre>const SimpleCard = (props) =&gt; {</pre><pre>let type = props.type ? CARD_TYPE[props.type] : &quot;customDefaultCard&quot;;</pre><pre>return (</pre><pre>&lt;div className={type}&gt;</pre><pre>&lt;Card className={props.className + &quot; w-20rem&quot;} title=&quot;Title&quot; subTitle=&quot;SubTitle&quot;&gt;</pre><pre>{props.children}</pre><pre>&lt;/Card&gt;</pre><pre>&lt;/div&gt;</pre><pre>);</pre><pre>};</pre><pre>export default SimpleCard;</pre><p>Then all we need to do is change the code in App.js like below,</p><pre>import React, { useState, useEffect } from &quot;react&quot;;</pre><pre>import { Menubar } from &quot;primereact/menubar&quot;;</pre><pre>import { Card } from &quot;primereact/card&quot;;</pre><pre>import { DataTable } from &quot;primereact/datatable&quot;;</pre><pre>import { Column } from &quot;primereact/column&quot;;</pre><pre>import SimpleCard from &quot;./components/SimpleCard&quot;;</pre><pre>import &quot;./App.css&quot;;</pre><pre>function App() {</pre><pre>const [products, setProducts] = useState([]);</pre><pre>// eslint-disable-next-line</pre><pre>const [items, setitems] = useState([</pre><pre>{</pre><pre>label: &quot;File&quot;,</pre><pre>icon: &quot;pi pi-fw pi-file&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-plus&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Bookmark&quot;,</pre><pre>icon: &quot;pi pi-fw pi-bookmark&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Video&quot;,</pre><pre>icon: &quot;pi pi-fw pi-video&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-trash&quot;,</pre><pre>},</pre><pre>{</pre><pre>separator: true,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Export&quot;,</pre><pre>icon: &quot;pi pi-fw pi-external-link&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Left&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-left&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Right&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-right&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Center&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-center&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Justify&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-justify&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Users&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-minus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Search&quot;,</pre><pre>icon: &quot;pi pi-fw pi-users&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Filter&quot;,</pre><pre>icon: &quot;pi pi-fw pi-filter&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Print&quot;,</pre><pre>icon: &quot;pi pi-fw pi-print&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>icon: &quot;pi pi-fw pi-bars&quot;,</pre><pre>label: &quot;List&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Events&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Save&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Archieve&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-times&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Remove&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Quit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-power-off&quot;,</pre><pre>},</pre><pre>]);</pre><pre>useEffect(() =&gt; {</pre><pre>fetch(&quot;https://jsonplaceholder.typicode.com/users&quot;)</pre><pre>.then((response) =&gt; response.json())</pre><pre>.then((data) =&gt; setProducts(data));</pre><pre>}, []);</pre><pre>return (</pre><pre>&lt;&gt;</pre><pre>&lt;Menubar model={items} /&gt;</pre><pre>&lt;div className=&quot;flex flex-row m-4 justify-between&quot;&gt;</pre><pre>&lt;SimpleCard title=&quot;Title&quot; className=&quot;m-2&quot; subTitle=&quot;SubTitle&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;SimpleCard type=&quot;SUCCESS&quot; className=&quot;m-2&quot; title=&quot;Title&quot; subTitle=&quot;SubTitle&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;SimpleCard type=&quot;DANGER&quot; className=&quot;m-2&quot; title=&quot;Title&quot; subTitle=&quot;SubTitle&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;SimpleCard type=&quot;WARN&quot; className=&quot;m-2&quot; title=&quot;Title&quot; subTitle=&quot;SubTitle&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;DataTable value={products} paginator rows={5} showGridlines stripedRows&gt;</pre><pre>&lt;Column style={{ width: &quot;10px&quot; }} field=&quot;id&quot; header=&quot;ID&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;name&quot; header=&quot;Name&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;80px&quot; }} field=&quot;username&quot; header=&quot;Username&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;180px&quot; }} field=&quot;email&quot; header=&quot;Email&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;phone&quot; header=&quot;Phone&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;website&quot; header=&quot;Website&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;company.name&quot; header=&quot;Company Name&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;company.catchPhrase&quot; header=&quot;About&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;/DataTable&gt;</pre><pre>&lt;/&gt;</pre><pre>);</pre><pre>}</pre><pre>export default App;</pre><p>Your output might look like this,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3OI7IZLIZqgMEMO8lwAtSw.png" /></figure><p>Now that we have setup the component, now we can tweak and test out some <a href="https://hype4.academy/tools/glassmorphism-generator">glass morphism</a> techniques to make the cards look more glass like.</p><p>Now just update your App.css with a few css classes,</p><pre>.customSuccessCard div.p-card {</pre><pre>background-image: linear-gradient(to right bottom, rgb(209, 250, 229), rgb(52, 211, 153), rgb(52, 211, 153));</pre><pre>}</pre><pre>.customDefaultCard div.p-card {</pre><pre>background-image: linear-gradient(to right bottom, rgb(248, 250, 252), rgb(148, 163, 184), rgb(148, 163, 184));</pre><pre>}</pre><pre>.customDangerCard div.p-card {</pre><pre>background-image: linear-gradient(to right bottom, rgb(254, 242, 242), rgb(248, 113, 113), rgb(248, 113, 113));</pre><pre>}</pre><pre>.customWarningCard div.p-card {</pre><pre>background-image: linear-gradient(to right bottom, rgb(255, 251, 235), rgb(252, 211, 77), rgb(251, 191, 36));</pre><pre>}</pre><pre>.dangerGlass div.p-card {</pre><pre>background: rgba(255, 0, 4, 0.55);</pre><pre>box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);</pre><pre>backdrop-filter: blur(7px);</pre><pre>-webkit-backdrop-filter: blur(15px);</pre><pre>}</pre><pre>.greenGlass div.p-card {</pre><pre>background: rgba(5, 112, 11, 0.55);</pre><pre>box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);</pre><pre>backdrop-filter: blur(5px);</pre><pre>-webkit-backdrop-filter: blur(15px);</pre><pre>}</pre><pre>.defaultGlass div.p-card {</pre><pre>background: rgba(231, 234, 231, 0.55);</pre><pre>box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);</pre><pre>backdrop-filter: blur(5.5px);</pre><pre>-webkit-backdrop-filter: blur(5.5px);</pre><pre>}</pre><pre>.infoGlass div.p-card {</pre><pre>background: rgba(49, 111, 237, 0.55);</pre><pre>box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);</pre><pre>backdrop-filter: blur(5.5px);</pre><pre>-webkit-backdrop-filter: blur(5.5px);</pre><pre>}</pre><pre>html {</pre><pre>background-color: #ffffff;</pre><pre>background-image: url(https://medium.com/&quot;data:image/svg+xml,%3Csvg%20xmlns=&#39;http://www.w3.org/2000/svg&#39;%20xmlns:xlink=&#39;http://www.w3.org/1999/xlink&#39;%20width=&#39;100%25&#39;%20height=&#39;100%25&#39;%3E%3Cdefs%3E%3Cpattern%20id=&#39;p&#39;%20width=&#39;250&#39;%20height=&#39;30&#39;%20patternUnits=&#39;userSpaceOnUse&#39;%20patternTransform=&#39;rotate(49) scale(2.99)&#39;%3E%3Cpath id=&#39;a&#39; data-color=&#39;outline&#39; fill=&#39;none&#39; stroke=&#39;%23DDE4DD&#39; stroke-width=&#39;7.67&#39; d=&#39;M-62.5-15C-31.3-15 0-7.5 0-7.5S31.3 0 62.5 0 125-7.5 125-7.5s31.3-7.5 62.5-7.5S250-7.5 250-7.5 281.3 0 312.5 0&#39;%3E%3C/path%3E%3Cuse xlink:href=&#39;%23a&#39; y=&#39;15&#39;%3E%3C/use%3E%3Cuse xlink:href=&#39;%23a&#39; y=&#39;30&#39;%3E%3C/use%3E%3Cuse xlink:href=&#39;%23a&#39; y=&#39;45&#39;%3E%3C/use%3E%3C/pattern%3E%3C/defs%3E%3Crect fill=&#39;url(https://medium.com/%23p)&#39; width=&#39;100%25&#39; height=&#39;100%25&#39;%3E%3C/rect%3E%3C/svg%3E&quot;);</pre><pre>background-size: cover;</pre><pre>background-position: center;</pre><pre>background-repeat: no-repeat;</pre><pre>}</pre><p>I have just added a pattern in the background so that the effect becomes visible.</p><p>Now change your SimpleCard.js to be like</p><pre>import React, { useState } from &quot;react&quot;;</pre><pre>import { Card } from &quot;primereact/card&quot;;</pre><pre>const CARD_TYPE = {</pre><pre>SUCCESS: &quot;customSuccessCard&quot;,</pre><pre>DANGER: &quot;customDangerCard&quot;,</pre><pre>WARN: &quot;customWarningCard&quot;,</pre><pre>DEFAULT: &quot;customDefaultCard&quot;,</pre><pre>DANGERGLASS: &quot;dangerGlass&quot;,</pre><pre>GREENGLASS: &quot;greenGlass&quot;,</pre><pre>DEFAULTGLASS: &quot;defaultGlass&quot;,</pre><pre>INFOGLASS: &quot;infoGlass&quot;,</pre><pre>};</pre><pre>const SimpleCard = (props) =&gt; {</pre><pre>let type = props.type ? CARD_TYPE[props.type] : &quot;customDefaultCard&quot;;</pre><pre>return (</pre><pre>&lt;div className={type}&gt;</pre><pre>&lt;Card className={props.className + &quot; w-20rem&quot;} title=&quot;Title&quot;&gt;</pre><pre>{props.children}</pre><pre>&lt;/Card&gt;</pre><pre>&lt;/div&gt;</pre><pre>);</pre><pre>};</pre><pre>export default SimpleCard;</pre><p>Now change your App.js to be like below,</p><pre>import React, { useState, useEffect } from &quot;react&quot;;</pre><pre>import { Menubar } from &quot;primereact/menubar&quot;;</pre><pre>import { Card } from &quot;primereact/card&quot;;</pre><pre>import { DataTable } from &quot;primereact/datatable&quot;;</pre><pre>import { Column } from &quot;primereact/column&quot;;</pre><pre>import SimpleCard from &quot;./components/SimpleCard&quot;;</pre><pre>import &quot;./App.css&quot;;</pre><pre>function App() {</pre><pre>const [products, setProducts] = useState([]);</pre><pre>// eslint-disable-next-line</pre><pre>const [items, setitems] = useState([</pre><pre>{</pre><pre>label: &quot;File&quot;,</pre><pre>icon: &quot;pi pi-fw pi-file&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-plus&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Bookmark&quot;,</pre><pre>icon: &quot;pi pi-fw pi-bookmark&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Video&quot;,</pre><pre>icon: &quot;pi pi-fw pi-video&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-trash&quot;,</pre><pre>},</pre><pre>{</pre><pre>separator: true,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Export&quot;,</pre><pre>icon: &quot;pi pi-fw pi-external-link&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Left&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-left&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Right&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-right&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Center&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-center&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Justify&quot;,</pre><pre>icon: &quot;pi pi-fw pi-align-justify&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Users&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;New&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-user-minus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Search&quot;,</pre><pre>icon: &quot;pi pi-fw pi-users&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Filter&quot;,</pre><pre>icon: &quot;pi pi-fw pi-filter&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Print&quot;,</pre><pre>icon: &quot;pi pi-fw pi-print&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>icon: &quot;pi pi-fw pi-bars&quot;,</pre><pre>label: &quot;List&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Events&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Edit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-pencil&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Save&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-plus&quot;,</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Delete&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Archieve&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-times&quot;,</pre><pre>items: [</pre><pre>{</pre><pre>label: &quot;Remove&quot;,</pre><pre>icon: &quot;pi pi-fw pi-calendar-minus&quot;,</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>],</pre><pre>},</pre><pre>{</pre><pre>label: &quot;Quit&quot;,</pre><pre>icon: &quot;pi pi-fw pi-power-off&quot;,</pre><pre>},</pre><pre>]);</pre><pre>useEffect(() =&gt; {</pre><pre>fetch(&quot;https://jsonplaceholder.typicode.com/users&quot;)</pre><pre>.then((response) =&gt; response.json())</pre><pre>.then((data) =&gt; setProducts(data));</pre><pre>}, []);</pre><pre>return (</pre><pre>&lt;&gt;</pre><pre>&lt;Menubar model={items} /&gt;</pre><pre>&lt;div className=&quot;bg max-w-full max-h-full flex flex-row m-4 justify-between&quot;&gt;</pre><pre>&lt;SimpleCard type=&quot;DEFAULTGLASS&quot; title=&quot;Title&quot; className=&quot;m-2&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;SimpleCard type=&quot;GREENGLASS&quot; className=&quot;m-2&quot; title=&quot;Title&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;SimpleCard type=&quot;DANGERGLASS&quot; className=&quot;m-2&quot; title=&quot;Title&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;SimpleCard type=&quot;INFOGLASS&quot; className=&quot;m-2&quot; title=&quot;Title&quot;&gt;</pre><pre>Content</pre><pre>&lt;/SimpleCard&gt;</pre><pre>&lt;/div&gt;</pre><pre>&lt;DataTable value={products} paginator rows={5}&gt;</pre><pre>&lt;Column style={{ width: &quot;10px&quot; }} field=&quot;id&quot; header=&quot;ID&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;name&quot; header=&quot;Name&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;80px&quot; }} field=&quot;username&quot; header=&quot;Username&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;180px&quot; }} field=&quot;email&quot; header=&quot;Email&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;phone&quot; header=&quot;Phone&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;website&quot; header=&quot;Website&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;company.name&quot; header=&quot;Company Name&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;Column style={{ width: &quot;120px&quot; }} field=&quot;company.catchPhrase&quot; header=&quot;About&quot;&gt;&lt;/Column&gt;</pre><pre>&lt;/DataTable&gt;</pre><pre>&lt;/&gt;</pre><pre>);</pre><pre>}</pre><pre>export default App;</pre><p>Now once you change the files, you can see a really good dashboard like below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lpMk0-UxXRnWXUZJ2yrVhw.png" /></figure><p>Now we have actually created a nice card, that looks like a sleek glass, i have applied the same to the table header as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ba3195d5b3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>