<?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 V.K on Medium]]></title>
        <description><![CDATA[Stories by V.K on Medium]]></description>
        <link>https://medium.com/@viswaretaskotra?source=rss-faaba29cd4db------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eDpEElMKZPyd9IC_4DmKFQ.jpeg</url>
            <title>Stories by V.K on Medium</title>
            <link>https://medium.com/@viswaretaskotra?source=rss-faaba29cd4db------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 04:51:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@viswaretaskotra/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[Nodus vs Modal: which is better for GPU training?]]></title>
            <link>https://medium.com/@viswaretaskotra/nodus-vs-modal-which-is-better-for-gpu-training-7fbb236e94fd?source=rss-faaba29cd4db------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fbb236e94fd</guid>
            <dc:creator><![CDATA[V.K]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 02:17:20 GMT</pubDate>
            <atom:updated>2026-10-14T02:17:20.900Z</atom:updated>
            <content:encoded><![CDATA[<p>Pick Modal if your training jobs are short, sit next to web endpoints, or need one large RDMA cluster. Pick Nodus if your runs last hours or days and the bill matters most. The Python API is nearly the same, listed GPU rates are lower on most cards, and when a machine is reclaimed Nodus restores your checkpoint on a new one rather than starting over.</p><p>We build Nodus, so we have tried to keep this fair. Every Modal fact links to Modal’s own docs or pricing page, the costs are worked out in the open, and there is a section on where Modal wins.</p><h3>How do Nodus and Modal compare at a glance?</h3><p><strong>Modal — Nodus</strong></p><h3>How you pay</h3><ul><li><strong>Modal:</strong> Per second, plus a monthly plan: Starter $0, Team $250</li><li><strong>Nodus:</strong> Prepaid credits. A funded hold is placed before work starts and renewed every 5 minutes</li></ul><h3>GPUs</h3><ul><li><strong>Modal:</strong> T4 to B300, up to 8 per container</li><li><strong>Nodus:</strong> RTX 3070 to B300, up to 8 per machine</li></ul><h3>Preemption</h3><ul><li><strong>Modal:</strong> GPU Functions are preemptible by default, with no opt-out; the call restarts on the same input</li><li><strong>Nodus:</strong> You choose whether a run may use interruptible capacity; your state directory is checkpointed and restored on the replacement machine</li></ul><h3>Longest single run</h3><ul><li><strong>Modal:</strong> 24 hours per Function call; longer runs resume through retries</li><li><strong>Nodus:</strong> Functions: 24 hours. Jobs: an optional wall-clock timeout you can raise or remove while the job runs</li></ul><h3>Multi-node</h3><ul><li><strong>Modal:</strong> Clusters of up to 32 nodes and 256 GPUs over RDMA</li><li><strong>Nodus:</strong> Beta: up to 8 nodes, after your first credit purchase</li></ul><h3>Cold starts</h3><ul><li><strong>Modal:</strong> Containers boot in about a second, before your imports and model loading</li><li><strong>Nodus:</strong> The estimate shows the expected start time before you run</li></ul><h3>Spend limits</h3><ul><li><strong>Modal:</strong> Monthly Workspace budget and spend limit; Environment budgets on Team and Enterprise</li><li><strong>Nodus:</strong> A hard dollar cap on each run plus Budgets that block new work</li></ul><h3>Coding agents</h3><ul><li><strong>Modal:</strong> Agent skills installed with modal skills install</li><li><strong>Nodus:</strong> An MCP server for Claude Code, Codex and Cursor; writes show a dry run first</li></ul><h3>Free credit</h3><ul><li><strong>Modal:</strong> $30 of compute every month on Starter</li><li><strong>Nodus:</strong> $30 once for a new org, valid for 30 days</li></ul><p>Sources: Modal <a href="https://modal.com/pricing">pricing</a>, <a href="https://modal.com/docs/guide/preemption">preemption</a>, <a href="https://modal.com/docs/guide/timeouts">timeouts</a>, <a href="https://modal.com/docs/guide/gpu">GPUs</a>, <a href="https://modal.com/docs/guide/multi-node-clusters">Clusters</a>, <a href="https://modal.com/docs/guide/cold-start">cold starts</a>, <a href="https://modal.com/docs/guide/budgets">budgets</a> and <a href="https://modal.com/docs/cli/latest/skills">modal skills</a>; the <a href="https://www.nodus-compute.ai/pricing/">Nodus pricing page</a> and the <a href="https://www.nodus-compute.ai/docs/getting-started/modal-users/">Nodus guide for Modal users</a>. Checked October 12, 2026.</p><h3>Is Nodus cheaper than Modal for training?</h3><p>On listed rates, yes for most GPUs. The gap is widest on older and mid-range cards like the A100, L40S and L4, and it nearly closes on the newest Blackwell parts.</p><p>Here are three ordinary training jobs priced at each platform’s listed GPU rate:</p><p><strong>Example job — GPU-hours — Modal — Nodus</strong></p><h3>LoRA fine-tune on 1 x A100 80 GB for 6 hours</h3><ul><li><strong>GPU-hours:</strong> 6</li><li><strong>Modal:</strong> $14.99</li><li><strong>Nodus:</strong> $6.54</li></ul><h3>Evaluation sweep: 40 runs, each 1 x L4 for 2.5 hours</h3><ul><li><strong>GPU-hours:</strong> 100</li><li><strong>Modal:</strong> $79.92</li><li><strong>Nodus:</strong> $43.00</li></ul><h3>Full fine-tune on 8 x H100 for 36 hours</h3><ul><li><strong>GPU-hours:</strong> 288</li><li><strong>Modal:</strong> $1,137.37</li><li><strong>Nodus:</strong> $748.80</li></ul><p>Prices checked October 12, 2026: Modal’s per-second GPU rates converted to hourly (H100 $3.9492, A100 80 GB $2.4984, L4 $0.7992) and the hourly supply prices on the Nodus pricing page (H100 $2.60, A100 80 GB $1.09, L4 $0.43). Modal bills CPU cores and memory on top of its GPU rates, and on Nodus nodus run --dry-run prints the expected cost of your exact run before anything starts.</p><p>A useful way to read the gap: one 8 x H100 machine kept busy for a week (168 hours) comes to $1,813 more at Modal’s listed rate. If you train a few short jobs a month, the gap is small next to the time a move takes. If your GPUs are busy most days, it adds up fast.</p><p>Listed rates are only a starting point, so we also measured. In two small pilots on October 11, 2026, we ran the same recipe on both platforms with Qwen2.5-0.5B on one NVIDIA L4, one seed and one accepted run each. Nodus produced byte-identical weights for 67% lower recorded charges in <a href="https://www.nodus-compute.ai/blog/nodus-vs-modal-fine-tuning-benchmark/">supervised fine-tuning</a> and 42.5% lower in <a href="https://www.nodus-compute.ai/blog/nodus-vs-modal-continued-pretraining-benchmark/">continued pretraining</a>.</p><p>Those are pilots, not a promise for your job. Counting a failed Nodus attempt, the fine-tuning saving drops to 24.7%, and the pretraining export took 11.0 minutes on Nodus against 7.7 on Modal.</p><h3>What happens when a GPU is preempted mid-run?</h3><p>On both platforms your training code has to save its own state. The difference is who handles everything around that save.</p><p>Modal says every Function can be preempted, that preemptions are rare, and that the chance grows with run length. When one happens, Modal sends an interrupt signal and restarts the Function on the same input. GPU Functions can’t opt out, because the nonpreemptible flag is not supported for them (<a href="https://modal.com/docs/guide/preemption">Modal preemption docs</a>). So you write checkpoints to a Modal Volume, look for the latest one when the Function starts and add retries, which is the pattern in Modal&#39;s own <a href="https://modal.com/docs/examples/long-training">long-training example</a>.</p><p>On Nodus your script writes its state to /nodus/state and loads it on start, and the platform does the rest. It sets the checkpoint cadence from how often the capacity is interrupted: at least four checkpoints over the expected run time, with saving kept to about a tenth of it. When a reclaim notice arrives, it asks for an urgent checkpoint and prepares a replacement machine at the same time. The replacement starts only once the old machine is provably gone, with the state directory restored, so you lose at most the work since the last committed checkpoint (<a href="https://www.nodus-compute.ai/docs/guides/checkpoints/">checkpoints guide</a>).</p><p>Whichever you pick, checkpoint often. On one 8 x H100 machine at Modal’s listed rate, a restart that throws away 3 hours of work costs 3 x 8 x $3.9492 = $94.78. With a checkpoint every 30 minutes, the same restart costs at most $15.80.</p><h3>Can one training run last longer than 24 hours?</h3><p>Not as a single call on Modal. A Modal Function call runs for at most 24 hours (<a href="https://modal.com/docs/guide/timeouts">Modal timeouts</a>). Modal’s long-training example covers longer runs by pairing a 24-hour timeout with up to 10 retries, each resuming from the last checkpoint in a Volume. The example says that gives a job about 10 days before you restart it by hand.</p><p>Nodus Functions have the same 24-hour ceiling, but long training usually runs as a Job. A Job’s wall-clock timeout is optional, and you can raise, lower or remove it while the job runs. Time spent suspended does not count. Recovery from lost machines is limited by attempts rather than a clock: 8 by default, 3 for multi-node jobs.</p><p>The 36-hour run from the table is one command on Nodus. Check the estimate first, then launch it with a cap a little above the estimate:</p><pre>nodus run --dry-run --gpu H100:8 --expected-duration 36h -- torchrun train.py<br>nodus run --gpu H100:8 --checkpoint /nodus/state --max-cost 800 -d -- torchrun train.py</pre><h3>Which is better for multi-node training?</h3><p>Modal, if you need more than 8 nodes or a guaranteed RDMA fabric. Modal Clusters run up to 32 nodes and 256 GPUs per cluster, with larger clusters on request. They come with a 3,200 Gbps RDMA network (6,400 Gbps on B300), and every node is gang-scheduled and physically colocated. Each node has to use all of its GPUs (<a href="https://modal.com/docs/guide/multi-node-clusters">Modal Clusters</a>).</p><p>Multi-node training on Nodus is in Beta. It is on for every organization with no access request, but gangs top out at 8 nodes and need a first credit purchase. By default every node sits on one provider’s private network in one region. You can allow nodes across providers, but in the Beta their traffic over public addresses is not encrypted.</p><p>When a node is lost, Nodus keeps the surviving machines, replaces only the lost ones and restarts every rank from the latest checkpoint. It sets the environment for torchrun, Ray and verl, so your launcher finds its peers without extra flags.</p><p>The rule we use: for fine-tuning or post-training on 2 to 8 nodes, either platform works. For a 16-node pretraining run, use Modal Clusters.</p><h3>Can a coding agent run training jobs on each?</h3><p>Yes, with different approaches. Nodus runs an MCP server that Claude Code, Codex and Cursor can call directly. nodus mcp install sets it up on your machine, or you can add the hosted server. Every write comes back as a dry run with a cost estimate and only runs once confirmed, and the agent works within your account&#39;s projects and spending limits.</p><p>Modal ships agent skills instead. <a href="https://modal.com/docs/cli/latest/skills">modal skills install</a> puts Modal&#39;s skills and documentation into your project&#39;s .agents/ or .claude/ folder, and your agent then drives the Modal CLI and SDK. For spending, Modal&#39;s <a href="https://modal.com/docs/guide/budgets">budgets</a> are monthly caps per workspace or environment, while Nodus can cap each run in dollars before it starts.</p><h3>When is Modal the better choice?</h3><p>Modal is the better pick in these cases, so check them before you move anything:</p><ul><li>You serve models next to your training code. Modal web endpoints (@modal.web_endpoint, @modal.asgi_app) have no equivalent in the Nodus SDK, which serves models through nodus.InferenceEndpoint instead.</li><li>Your code depends on modal.Dict, modal.Queue or parametrized classes. Nodus supports none of them today.</li><li>You need more than 8 nodes in one job, or a guaranteed RDMA network between them.</li><li>Your workload is bursty and latency-sensitive. Modal containers boot in about a second, and its <a href="https://modal.com/docs/guide/cold-start">cold start guide</a> explains how to keep warm pools.</li><li>You want a ready-made training library. Modal’s <a href="https://modal.com/docs/guide/training-quickstart">training quickstart</a> points to Modal Dojo, an open-source library for supervised fine-tuning and RL, while managed training on Nodus is still in Beta.</li></ul><p>On B200 and B300 the listed gap is much smaller, so for Blackwell work the choice comes down to features rather than price.</p><h3>How do you move a Modal training function to Nodus?</h3><p>Change the import, then trade the Volume-and-retries recovery for a checkpoint path, a cost cap and, if you want it, interruptible capacity. Here is the same function on both platforms:</p><pre># Modal: checkpoints in a Volume, retries to resume<br>@app.function(<br>    gpu=&quot;H100:8&quot;,<br>    volumes={&quot;/ckpt&quot;: volume},<br>    timeout=24 * 60 * 60,<br>    retries=modal.Retries(initial_delay=0.0, max_retries=10),<br>)<br>def train(): ...</pre><pre># Nodus: the same function after `import nodus`<br>@app.function(<br>    gpu=&quot;H100:8&quot;,<br>    timeout=&quot;24h&quot;,<br>    max_cost=600,               # hard cap in USD<br>    checkpoint=&quot;/nodus/state&quot;,  # saved, then restored if the machine is reclaimed<br>    interruptible=True,         # allow cheaper interruptible capacity<br>)<br>def train(): ...</pre><p>Inside train, load the model, optimizer and step from /nodus/state if they exist, and save there as you go. App, .remote(), .map(), .spawn(), Image, Volume and Secret keep their Modal names. Install with pip install nodus-compute, sign in with nodus login, then nodus run app.py. The <a href="https://www.nodus-compute.ai/docs/getting-started/modal-users/">Modal users guide</a> lists every mapping and gap.</p><h3>FAQ</h3><h3>Does Modal code need changes beyond the import?</h3><p>Usually small ones. Durations accept strings like “6h”, but days are not a unit, and the image’s Python minor version must match yours, as on Modal. Parametrized classes raise nodus.errors.Unsupported, so set them up in an @nodus.enter() hook instead.</p><h3>Can I use Modal and Nodus together?</h3><p>Yes. One sensible split is serving on Modal web endpoints and running long training on Nodus, passing weights through Hugging Face or your own S3 bucket. Nodus Volumes can import directly from Hugging Face, git, URLs and S3.</p><h3>Can I keep training data in Europe on both?</h3><p>Yes. Modal lets you pin a region, and pinned Functions cost 1.15x base prices for a broad region like eu and 1.75x for a narrow one (<a href="https://modal.com/docs/guide/region-selection">Modal region selection</a>). On Nodus you pass region classes such as eu or uk, and the run is placed only on offerings in those classes, each at its own listed rate.</p><h3>How do the free credits differ?</h3><p>Modal’s Starter plan includes $30 of compute every month. Nodus gives your first org $30 once, after your email and card are verified, and it expires 30 days after it is issued. Orgs on starter credit alone also have tighter limits until the first top-up.</p><p>This article first appeared on the <a href="https://www.nodus-compute.ai/blog/nodus-vs-modal/">Nodus Compute blog</a>, where we keep it up to date.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fbb236e94fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Simple and Elegant React Website in 30 Minutes]]></title>
            <link>https://medium.com/@viswaretaskotra/how-to-build-a-simple-and-elegant-react-website-in-30-minutes-132b92cc0dd5?source=rss-faaba29cd4db------2</link>
            <guid isPermaLink="false">https://medium.com/p/132b92cc0dd5</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[V.K]]></dc:creator>
            <pubDate>Sat, 12 Aug 2023 17:55:49 GMT</pubDate>
            <atom:updated>2023-08-12T17:55:49.235Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever wanted to create your own website from scratch, but felt overwhelmed by the complexity and jargon of web development? Do you wish there was a simple and fun way to learn the basics of building a modern and interactive web page?</p><p>If so, you’re in luck! In this article, I will show you how to create a basic React website for beginners, using only a few lines of code and some creativity. React is a popular and powerful JavaScript library that lets you create dynamic user interfaces with ease. You don’t need any prior experience with React or web development to follow along. By the end of this article, you will have a working website that you can customize and share with the world. Let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/0*pD_E_wLcjtSUo0IB.png" /></figure><p>To build a basic react website, we need to follow a few steps. First, we need to set up the environment and install the necessary dependencies, such as react, react-dom, and react-router-dom. This article, however, assumes that you have already taken care of those necessities.</p><p>If not then I am more than happy to lead you in the right direction to get those things up to speed. The YouTube video I’ve linked below is by the youtuber Programming with Mosh and its a fantastic way to set up everything that is necessary!</p><p>React setup &amp; basics: <a href="https://www.youtube.com/watch?v=SqcY0GlETPk&amp;t=1280s">React Tutorial</a> (click this link!)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*O1H6u2YTYYBwh3tH" /><figcaption>React setup &amp; basics: <a href="https://www.youtube.com/watch?v=SqcY0GlETPk&amp;t=1280s">React Tutorial</a></figcaption></figure><p>Next, we need to create the components for each part of the website, such as the navigation bar, the main contents, and the footer. We will use functional components. Functional components are a way of creating React components using JavaScript functions. They are simpler and easier to write than class components, and they can use React hooks to manage state and lifecycle methods. Functional components take props as an argument and return JSX code to render the UI. For example, this is a functional component that displays a greeting message:</p><pre>function Greeting(props) {<br>  return &lt;h1&gt;Hello, {props.name}&lt;/h1&gt;;<br>}</pre><p>Next, we need to use JSX to render the components in the App.js file, which is the root component of our website. We can also use props and state to pass data and manage the UI.</p><p>We can start off with the code below in the App.tsx file which does nothing more than set up our application.</p><pre>import React from &quot;react&quot;;<br>import &quot;./App.css&quot;;<br><br>// Define the App component that renders the Header, Main, and Footer components<br>const App: React.FC = () =&gt; {<br>  return (<br>    &lt;div className=&quot;App&quot;/&gt;<br>  );<br>};<br><br>export default App;</pre><p>The explanantion for the code as follows:</p><ul><li>The first line imports React to use JSX and React features. The second line imports the App.css file for styling.</li><li>The third line defines the App component as a functional component using an arrow function. It does not take any props.</li><li>The fourth line returns JSX with a &lt;div&gt; element that has a className of “App”. This is like the class attribute in HTML, but renamed to avoid confusion with JavaScript.</li><li>The fifth line exports the App component as the default export. This lets you import it without curly braces in other files.</li></ul><p>Next we go to build the navigation bar at the top of the website.</p><p>Add a new folder called “LandingPage”, this is where we will place the navigation bar as well as the main body for the introduction page.</p><p>It is good practice to keep every page that you will have in your website as a separate folder as it keeps everything organized and won&#39;t get confusing when similar file names start to pop up.</p><p>Next make the file “Header.tsx”. Here we will keep the navigation bar that will go at the top of the page.</p><pre>import {<br>  faHome,<br>  faInfoCircle,<br>  faCog,<br>  faEnvelope,<br>} from &quot;@fortawesome/free-solid-svg-icons&quot;;<br>import { FontAwesomeIcon } from &quot;@fortawesome/react-fontawesome&quot;;<br><br>// Define an interface for the props of the NavItem component<br>interface NavItemProps {<br>  icon: any;<br>  link: string;<br>}<br><br>// Define a functional component named NavItem<br>const NavItem: React.FC&lt;NavItemProps&gt; = ({ icon, link }) =&gt; {<br>  // Return a JSX element that renders the icon and link props as a list item with an anchor tag<br>  return (<br>    &lt;li className=&quot;nav-item&quot;&gt;<br>      &lt;a href={link}&gt;<br>        &lt;FontAwesomeIcon icon={icon} /&gt;<br>      &lt;/a&gt;<br>    &lt;/li&gt;<br>  );<br>};<br><br>// Define an array of objects that represent the navigation items<br>const navItems = [<br>  { icon: faHome, link: &quot;#&quot; },<br>  { icon: faInfoCircle, link: &quot;#&quot; },<br>  { icon: faCog, link: &quot;#&quot; },<br>  { icon: faEnvelope, link: &quot;#&quot; },<br>];<br><br>// Define a functional component named Header<br>const Header: React.FC = () =&gt; {<br>  // Return a JSX element that renders the header of the website<br>  return (<br>    &lt;div className=&quot;header&quot;&gt;<br>      &lt;h1&gt;My Website&lt;/h1&gt;<br>      &lt;ul className=&quot;nav-list&quot;&gt;<br>        {navItems.map((item, index) =&gt; (<br>          &lt;NavItem key={index} icon={item.icon} link={item.link} /&gt;<br>        ))}<br>      &lt;/ul&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default Header;</pre><p>The explanantion for the code:</p><p>First, let’s start with the imports. You need to import some modules to use their features in your code. For example, you need to import React to use JSX and React components. You also need to import some icons from Font Awesome and a component that lets you use them in React. You will have to install fortawesome module. Here is the code snippet for the imports:</p><pre>import React from &quot;react&quot;;<br>import {<br>  faHome,<br>  faInfoCircle,<br>  faCog,<br>  faEnvelope,<br>} from &quot;@fortawesome/free-solid-svg-icons&quot;;<br>import { FontAwesomeIcon } from &quot;@fortawesome/react-fontawesome&quot;;</pre><p>Next, let’s define the NavItem component. This component will render a single navigation item with an icon and a link. You need to define an interface for the props of this component, which are the data that you can pass to it. The interface has two properties: icon and link. The icon property is of type any, which means it can be anything. The link property is of type string, which means it must be a text value. Here is the code snippet for the interface:</p><pre>interface NavItemProps {<br>  icon: any;<br>  link: string;<br>}</pre><p>Then, you need to define the function that returns the JSX for the NavItem component. The function takes the props as a parameter and destructures them into icon and link variables. The function returns a JSX element that uses a &lt;li&gt; element with a className of “nav-item”. The className attribute is equivalent to the class attribute in HTML, but it is renamed to avoid confusion with the JavaScript keyword class. The &lt;li&gt; element contains an &lt;a&gt; element with an href attribute that has the link value. The &lt;a&gt; element also contains a FontAwesomeIcon component that has an icon prop that has the icon value. Here is the code snippet for the function:</p><pre>const NavItem: React.FC&lt;NavItemProps&gt; = ({ icon, link }) =&gt; {<br>  return (<br>    &lt;li className=&quot;nav-item&quot;&gt;<br>      &lt;a href={link}&gt;<br>        &lt;FontAwesomeIcon icon={icon} /&gt;<br>      &lt;/a&gt;<br>    &lt;/li&gt;<br>  );<br>};</pre><p>Finally, let’s define the Header component. This component will render the header of the website with a title and a list of navigation items. You need to define an array of objects that represent the navigation items. Each object has an icon and a link property that match the interface of the NavItem component. You can use any icons from Font Awesome that you like. Here is the code snippet for the array:</p><pre>const navItems = [<br>  { icon: faHome, link: &quot;#&quot; },<br>  { icon: faInfoCircle, link: &quot;#&quot; },<br>  { icon: faCog, link: &quot;#&quot; },<br>  { icon: faEnvelope, link: &quot;#&quot; },<br>];</pre><p>Then, you need to define the function that returns the JSX for the Header component. The function does not take any props, so it has an empty parameter list. The function returns a JSX element that uses a &lt;div&gt; element with a className of “header”. The &lt;div&gt; element contains an &lt;h1&gt; element with some text that says “My Website”. The &lt;div&gt; element also contains an &lt;ul&gt; element with a className of “nav-list”. The &lt;ul&gt; element uses the map method to iterate over the navItems array and render each item as a NavItem component. The map method takes a callback function that takes an item and an index as parameters and returns a JSX element. The JSX element uses a key prop that has the index value to help React identify each item in the list. The JSX element also passes the item.icon and item.link values as props to the NavItem component. Here is the code snippet for the function:</p><pre>const Header: React.FC = () =&gt; {<br>  return (<br>    &lt;div className=&quot;header&quot;&gt;<br>      &lt;h1&gt;My Website&lt;/h1&gt;<br>      &lt;ul className=&quot;nav-list&quot;&gt;<br>        {navItems.map((item, index) =&gt; (<br>          &lt;NavItem key={index} icon={item.icon} link={item.link} /&gt;<br>        ))}<br>      &lt;/ul&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><p>That’s it! You have defined two components: NavItem and Header, and used them to render a simple website header with icons and links. I hope this explanation helps you understand the code better.</p><p>Next we move on to the main body contents.</p><p>Make a file named: “MainBody.tsx” in the folder LandingPage that we made above.</p><p>This is the code which we will be going over shortly for the MainBody.tsx file:</p><pre>import {<br>  faHome,<br>  faInfoCircle,<br>  faCog,<br>  faEnvelope,<br>} from &quot;@fortawesome/free-solid-svg-icons&quot;;<br>import { FontAwesomeIcon } from &quot;@fortawesome/react-fontawesome&quot;;<br><br>const bodyItems = [<br>  {<br>    title: &quot;Home&quot;,<br>    icon: faHome,<br>    text: &quot;This is where you can find the main information about my website.&quot;,<br>  },<br>  {<br>    title: &quot;About&quot;,<br>    icon: faInfoCircle,<br>    text: &quot;This is where you can learn more about me and my background.&quot;,<br>  },<br>  {<br>    title: &quot;Services&quot;,<br>    icon: faCog,<br>    text: &quot;This is where you can see what I can offer you and how I can help you.&quot;,<br>  },<br>  {<br>    title: &quot;Contact&quot;,<br>    icon: faEnvelope,<br>    text: &quot;This is where you can get in touch with me and send me your feedback.&quot;,<br>  },<br>];<br><br>// Define a functional component named Main<br>const Main: React.FC = () =&gt; {<br>  // Return a JSX element that renders the main content of the website<br>  return (<br>    &lt;div className=&quot;main&quot;&gt;<br>      &lt;div className=&quot;hero&quot;&gt;<br>        &lt;h2&gt;Welcome to my website!&lt;/h2&gt;<br>        &lt;p&gt;<br>          This is a basic template website made with React TypeScript.<br>          Feel free to use it in any way you wish!<br>        &lt;/p&gt;<br>        &lt;button&gt;Learn More&lt;/button&gt;<br>      &lt;/div&gt;<br><br>      &lt;div className=&quot;features&quot;&gt;<br>        &lt;div<br>          className=&quot;feature&quot;<br>          style={{ display: &quot;flex&quot;, flexDirection: &quot;row&quot; }}<br>        &gt;<br>          {bodyItems.map(({ title, icon, text }) =&gt; (<br>            &lt;div<br>              key={title}<br>              style={{<br>                display: &quot;flex&quot;,<br>                flexDirection: &quot;column&quot;,<br>                alignItems: &quot;center&quot;,<br>                margin: &quot;10px&quot;,<br>                padding: &quot;10px&quot;,<br>              }}<br>            &gt;<br>              &lt;FontAwesomeIcon icon={icon} /&gt;<br>              &lt;h3&gt;{title}&lt;/h3&gt;<br>              &lt;p&gt;{text}&lt;/p&gt;<br>            &lt;/div&gt;<br>          ))}<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default Main;</pre><p>The expanantion for the code above as follows:</p><p>First, let’s start with the imports. You need to import some modules to use their features in your code. For example, you need to import some icons from Font Awesome and a component that lets you use them in React. Here is the code snippet for the imports:</p><pre>import {<br>  faHome,<br>  faInfoCircle,<br>  faCog,<br>  faEnvelope,<br>} from &quot;@fortawesome/free-solid-svg-icons&quot;;<br>import { FontAwesomeIcon } from &quot;@fortawesome/react-fontawesome&quot;;</pre><p>Next, let’s define the bodyItems array. This array contains some objects that represent the main content of the website. Each object has three properties: title, icon, and text. The title property is of type string, which means it must be a text value. The icon property is of type any, which means it can be anything. The text property is of type string, which means it must be a text value. You can use any icons from Font Awesome that you like. Here is the code snippet for the array:</p><pre>const bodyItems = [<br>  {<br>    title: &quot;Home&quot;,<br>    icon: faHome,<br>    text: &quot;This is where you can find the main information about my website.&quot;,<br>  },<br>  {<br>    title: &quot;About&quot;,<br>    icon: faInfoCircle,<br>    text: &quot;This is where you can learn more about me and my background.&quot;,<br>  },<br>  {<br>    title: &quot;Services&quot;,<br>    icon: faCog,<br>    text: &quot;This is where you can see what I can offer you and how I can help you.&quot;,<br>  },<br>  {<br>    title: &quot;Contact&quot;,<br>    icon: faEnvelope,<br>    text: &quot;This is where you can get in touch with me and send me your feedback.&quot;,<br>  },<br>];</pre><p>Then, let’s define the Main component. This component will render the main content of the website with a hero section and a features section. You need to define a function that returns the JSX for the Main component. The function does not take any props, so it has an empty parameter list. The function returns a JSX element that uses a &lt;div&gt; element with a className of “main”. The className attribute is equivalent to the class attribute in HTML, but it is renamed to avoid confusion with the JavaScript keyword class. Here is the code snippet for the function:</p><pre>const Main: React.FC = () =&gt; {<br>  return (<br>    &lt;div className=&quot;main&quot;&gt;<br>      // JSX for the hero section<br>      // JSX for the features section<br>    &lt;/div&gt;<br>  );<br>};</pre><p>Next, let’s look at the JSX for the hero section. The hero section is a part of the website that shows a welcome message and a button. You need to use another &lt;div&gt; element with a className of “hero” inside the main &lt;div&gt; element. The hero &lt;div&gt; element contains an &lt;h2&gt; element with some text that says “Welcome to my website!”. The hero &lt;div&gt; element also contains a &lt;p&gt; element with some text that explains what the website is about. The hero &lt;div&gt; element also contains a &lt;button&gt; element with some text that says “Learn More”. Here is the code snippet for the JSX for the hero section:</p><pre>&lt;div className=&quot;hero&quot;&gt;<br>  &lt;h2&gt;Welcome to my website!&lt;/h2&gt;<br>  &lt;p&gt;<br>    This is a basic template website made with React TypeScript.<br>    Feel free to use it in any way you wish!<br>  &lt;/p&gt;<br>  &lt;button&gt;Learn More&lt;/button&gt;<br>&lt;/div&gt;</pre><p>Finally, let’s look at the JSX for the features section. The features section is a part of the website that shows four features with icons and texts. You need to use another &lt;div&gt; element with a className of “features” inside the main &lt;div&gt; element. The features &lt;div&gt; element contains another &lt;div&gt; element with a className of “feature” and some inline styles that set its display to flex and its flexDirection to row. This means that it will arrange its children elements horizontally in a row. The feature &lt;div&gt; element uses the map method to iterate over the bodyItems array and render each item as another &lt;div&gt; element with some inline styles that set its display to flex, its flexDirection to column, its alignItems to center, its margin to 10px, and its padding to 10px. This means that it will arrange its children elements vertically in a column, center them, and add some space around them. The map method takes a callback function that takes an item as a parameter and destructures it into title, icon, and text variables. The callback function returns a JSX element that uses a key prop that has the title value to help React identify each item in the list. The JSX element also uses a FontAwesomeIcon component that has an icon prop that has the icon value. The JSX element also uses an &lt;h3&gt; element with the title value and a &lt;p&gt; element with the text value. Here is the code snippet for the JSX for the features section:</p><pre>&lt;div className=&quot;features&quot;&gt;<br>  &lt;div<br>    className=&quot;feature&quot;<br>    style={{ display: &quot;flex&quot;, flexDirection: &quot;row&quot; }}<br>  &gt;<br>    {bodyItems.map(({ title, icon, text }) =&gt; (<br>      &lt;div<br>        key={title}<br>        style={{<br>          display: &quot;flex&quot;,<br>          flexDirection: &quot;column&quot;,<br>          alignItems: &quot;center&quot;,<br>          margin: &quot;10px&quot;,<br>          padding: &quot;10px&quot;,<br>        }}<br>      &gt;<br>        &lt;FontAwesomeIcon icon={icon} /&gt;<br>        &lt;h3&gt;{title}&lt;/h3&gt;<br>        &lt;p&gt;{text}&lt;/p&gt;<br>      &lt;/div&gt;<br>    ))}<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>That’s it! You have defined one component: Main, and used it to render a simple website main content with a hero section and a features section.</p><p>Lastly we need to create the footer for the website. This will be the easiest part to get done so without further ado, lets go!</p><pre>// Define a functional component named Footer<br>const StandardFooter: React.FC = () =&gt; {<br>  // Return a JSX element that renders the footer of the website<br>  return (<br>    &lt;div className=&quot;footer&quot;&gt;<br>      &lt;p&gt;© 2023 by My Website. All rights reserved.&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default StandardFooter;</pre><p>Explanation:</p><p>First, let’s define the Footer component. This component will render the footer of the website with some text. You need to define a function that returns the JSX for the Footer component. The function does not take any props, so it has an empty parameter list. The function returns a JSX element that uses a &lt;div&gt; element with a className of “footer”. The className attribute is equivalent to the class attribute in HTML, but it is renamed to avoid confusion with the JavaScript keyword class. The &lt;div&gt; element contains a &lt;p&gt; element with some text that says “© 2023 by My Website. All rights reserved.”. Here is the code snippet for the function:</p><pre>const Footer: React.FC = () =&gt; {<br>  return (<br>    &lt;div className=&quot;footer&quot;&gt;<br>      &lt;p&gt;© 2023 by My Website. All rights reserved.&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><p>That’s it! You have defined one component: Footer, and used it to render a simple website footer with some text.</p><p>Now we do the CSS styling for the App.css file so that we have the website look the way we want.</p><pre>/* Import Google Fonts */<br>@import url(&#39;https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab&amp;display=swap&#39;);<br><br>/* Set the color scheme */<br>:root {<br>  --primary-color: hsl(289, 71%, 49%);<br>  --secondary-color: #a218ec;<br>  --tertiary-color: hsl(289, 71%, 49%);<br>  --quaternary-color: #090404;<br>  --quinary-color: #000000;<br>  --bg-color: #ffffff;<br>  --text-color: #000000;<br>}<br><br>/* Set the body properties */<br>body {<br>  margin: 0;<br>  font-family: &#39;Roboto&#39;, sans-serif;<br>}<br><br>/* Set the App properties */<br>.App {<br>  display: flex;<br>  flex-direction: column;<br>  min-height: 100vh;<br>  /* background-color: var(--bg-color); */<br>  /* color: var(--text-color); */<br>}<br><br>/* Set the header properties */<br>.header {<br>  display: flex;<br>  justify-content: space-between;<br>  align-items: center;<br>  background-color: var(--primary-color);<br>  color: var(--quaternary-color);<br>}<br><br>/* Set the header h1 properties */<br>.header h1 {<br>  margin-left: 20px;<br>  font-family: &#39;Roboto Slab&#39;, serif;<br>}<br><br>/* Set the nav-list properties */<br>.nav-list {<br>  display: flex;<br>  list-style-type: none;<br>}<br><br>/* Set the nav-item properties */<br>.nav-item {<br>  margin-right: 20px;<br>}<br><br>/* Set the nav-item a properties */<br>.nav-item a {<br>  color: var(--quaternary-color);<br>  text-decoration: none;<br>}<br><br>/* Set the nav-item hover effect */<br>.nav-item:hover {<br>  background-color: var(--secondary-color);<br>}<br><br>/* Set the main properties */<br>.main {<br>  flex-grow: 1;<br>}<br><br>/* Set the hero properties */<br>.hero {<br>    display: flex; /* This makes the hero element a flex container */<br>    flex-direction: column; /* This makes the flex items stack vertically */<br>    align-items: center; /* This makes the flex items align horizontally in the center */<br>    justify-content: space-evenly; /* This makes the flex items distribute evenly along the vertical axis */<br>    height: 80vh;<br>    background-image: url(&#39;https://images.unsplash.com/photo-1508615070457-7baeba4003e4?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=1350&amp;q=80&#39;);<br>    background-size: cover;<br>    background-position: center;<br>  }<br><br>/* Set the hero h2 properties */<br>.hero h2 {<br>  color: var(--quaternary-color);<br>  font-family: &#39;Roboto Slab&#39;, serif;<br>}<br><br>/* Set the hero p properties */<br>.hero p {<br>  color: var(--quaternary-color);<br>}<br><br>/* Set the hero button properties */<br>.hero button {<br>  padding: 10px 20px;<br>  border: none;<br>  border-radius: 5px;<br>  background-color: var(--secondary-color);<br>  color: var(--quaternary-color);<br>}<br><br>/* Set the hero button hover effect */<br>.hero button:hover {<br>  transform: scale(1.1);<br>}<br><br>/* Set the features properties */<br>.features {<br>  display: grid;<br>  grid-template-columns: repeat(4, auto);<br>}<br><br>/* Set the feature properties */<br>.feature {<br>  display: flex;<br>  flex-direction: column;<br>  justify-content: center;<br>  align-items: center;<br>  padding: 20px;<br>}<br><br>/* Set the feature icon properties */<br>.feature svg {<br>  font-size: 40px;<br>  color: var(--primary-color);<br>}<br><br>/* Set the feature h3 properties */<br>.feature h3 {<br>  margin-top: 10px;<br>}<br><br>/* Set the feature p properties */<br>.feature p {<br>  text-align: center;<br>}<br><br>/* Set the footer properties */<br>.footer {<br>  background-color: var(--primary-color);<br>  color: var(--quaternary-color);<br>  text-align: center;<br>}</pre><p>Explanation:</p><p>First, let’s look at the import statement. This statement imports some fonts from Google Fonts, which is a service that provides free fonts for your website. You can use the <a href="http://twitter.com/import">@import</a> rule to import fonts or other CSS files into your CSS file. Here is the code snippet for the import statement:</p><pre>/* Import Google Fonts */<br>@import url(&#39;https://fonts.googleapis.com/css?family=Roboto|Roboto+Slab&amp;display=swap&#39;);</pre><p>Next, let’s look at the root selector. This selector targets the root element of the document, which is usually the &lt;html&gt; element. You can use the :root selector to define variables that can be used throughout your CSS file. Variables are a way of storing values that can be reused or changed later. You can use the var() function to access the variables in your CSS file. In this case, the root selector defines some variables for the color scheme of your website. You can use different color formats to specify colors, such as hexadecimal, RGB, HSL, or keywords. Here is the code snippet for the root selector:</p><pre>/* Set the color scheme */<br>:root {<br>  --primary-color: hsl(289, 71%, 49%);<br>  --secondary-color: #a218ec;<br>  --tertiary-color: hsl(289, 71%, 49%);<br>  --quaternary-color: #090404;<br>  --quinary-color: #000000;<br>  --bg-color: #ffffff;<br>  --text-color: #000000;<br>}</pre><p>Then, let’s look at the body selector. This selector targets the &lt;body&gt; element of the document, which contains all the visible content of your website. You can use the body selector to set some global styles for your website, such as margin, font-family, background-color, or color. The margin property sets the space around an element’s border. The font-family property sets the font that is used for the text in an element. The background-color property sets the color that fills the background of an element. The color property sets the color of the text in an element. Here is the code snippet for the body selector:</p><pre>/* Set the body properties */<br>body {<br>  margin: 0;<br>  font-family: &#39;Roboto&#39;, sans-serif;<br>}</pre><p>Next, let’s look at the App selector. This selector targets an element with a className of “App”. The className attribute is equivalent to the class attribute in HTML, but it is renamed to avoid confusion with the JavaScript keyword class. You can use a dot (.) before a class name to select elements with that class name in CSS. In this case, the App selector targets a &lt;div&gt; element that is used as a container for your React app. You can use React to create components that can display data, handle events, and manage state in your website. React uses JSX, which is a syntax extension that looks like HTML but is actually JavaScript. The App selector sets some styles for your app container, such as display, flex-direction, and min-height. The display property sets how an element is displayed on the screen. The flex-direction property sets how flex items are placed in a flex container. A flex container is an element that uses display: flex or display: inline-flex to arrange its children elements in a flexible way. A flex item is a child element of a flex container. The min-height property sets the minimum height of an element. Here is the code snippet for the App selector:</p><pre>/* Set the App properties */<br>.App {<br>  display: flex;<br>  flex-direction: column;<br>  min-height: 100vh;<br>}</pre><p>Next, let’s look at the header h1 selector. This selector targets an &lt;h1&gt; element that is a descendant of an element with a className of “header”. You can use a space between two selectors to select elements that are descendants of another element in CSS. A descendant is an element that is nested inside another element in the HTML structure. In this case, the header h1 selector targets an &lt;h1&gt; element that is inside a &lt;div&gt; element with a className of “header”. The header h1 selector sets some styles for your header title, such as margin-left and font-family. The margin-left property sets the space to the left of an element’s border. The font-family property sets the font that is used for the text in an element. Here is the code snippet for the header h1 selector:</p><pre>/* Set the header h1 properties */<br>.header h1 {<br>  margin-left: 20px;<br>  font-family: &#39;Roboto Slab&#39;, serif;<br>}</pre><p>Then, let’s look at the nav-list selector. This selector targets an element with a className of “nav-list”. The nav-list selector targets a &lt;ul&gt; element that is used as a component for your website navigation list. The navigation list displays four items with icons and links for your website. The nav-list selector sets some styles for your navigation list component, such as display and list-style-type. The display property sets how an element is displayed on the screen. The list-style-type property sets the style of the list item markers in a list. Here is the code snippet for the nav-list selector:</p><pre>/* Set the nav-list properties */<br>.nav-list {<br>  display: flex;<br>  list-style-type: none;<br>}</pre><p>Next, let’s look at the nav-item selector. This selector targets an element with a className of “nav-item”. The nav-item selector targets a &lt;li&gt; element that is a child of an element with a className of “nav-list”. You can use a greater-than sign (&gt;) between two selectors to select elements that are direct children of another element in CSS. A direct child is an element that is one level below another element in the HTML structure. In this case, the nav-item selector targets a &lt;li&gt; element that is inside a &lt;ul&gt; element with a className of “nav-list”. The nav-item selector sets some styles for your navigation item component, such as margin-right. The margin-right property sets the space to the right of an element’s border. Here is the code snippet for the nav-item selector:</p><pre>/* Set the nav-item properties */<br>.nav-item {<br>  margin-right: 20px;<br>}</pre><p>Then, let’s look at the nav-item a selector. This selector targets an &lt;a&gt; element that is a descendant of an element with a className of “nav-item”. You can use a space between two selectors to select elements that are descendants of another element in CSS. A descendant is an element that is nested inside another element in the HTML structure. In this case, the nav-item a selector targets an &lt;a&gt; element that is inside a &lt;li&gt; element with a className of “nav-item”. The nav-item a selector sets some styles for your navigation item link component, such as color and text-decoration. The color property sets the color of the text in an element. The text-decoration property sets how text should be decorated in an element, such as adding underlines or removing them. Here is the code snippet for the nav-item a selector:</p><pre>/* Set the nav-item a properties */<br>.nav-item a {<br>  color: var(--quaternary-color);<br>  text-decoration: none;<br>}</pre><p>Next, let’s look at the nav-item hover effect. This effect changes how an element looks when you hover over it with your mouse cursor. You can use a colon (:) followed by pseudo-classes to select elements based on their state or position in CSS. A pseudo-class is a keyword that represents a special state or position of an element. In this case, you can use :hover to select elements when they are hovered over by your mouse cursor. The nav-item:hover selector targets an element with a className of “nav-item” when it is hovered over by your mouse cursor. The nav-item:hover selector sets some styles for your navigation item component when it is hovered over, such as background-color. The background-color property sets the color that fills the background of an element. Here is the code snippet for the nav-item hover effect:</p><pre>/* Set the nav-item hover effect */<br>.nav-item:hover {<br>  background-color: var(--secondary-color);<br>}</pre><p>Then, let’s look at the main selector. This selector targets an element with a className of “main”. The main selector targets a &lt;div&gt; element that is used as a component for your website main content. The main content displays a hero section and a features section for your website. The main selector sets some styles for your main content component, such as flex-grow. The flex-grow property sets how much a flex item can grow relative to the rest of the flex items in a flex container. A flex item is a child element of a flex container. A flex container is an element that uses display: flex or display: inline-flex to arrange its children elements in a flexible way. Here is the code snippet for the main selector:</p><pre>/* Set the main properties */<br>.main {<br>  flex-grow: 1;<br>}</pre><p>Next, let’s look at the hero selector. This selector targets an element with a className of “hero”. The hero selector targets a &lt;div&gt; element that is used as a component for your website hero section. The hero section displays a welcome message and a button for your website. The hero selector sets some styles for your hero component, such as display, flex-direction, align-items, justify-content, height, background-image, background-size, and background-position. The display property sets how an element is displayed on the screen. The flex-direction property sets how flex items are placed in a flex container. A flex container is an element that uses display: flex or display: inline-flex to arrange its children elements in a flexible way. A flex item is a child element of a flex container. The align-items property sets how flex items are aligned along the cross axis in a flex container. The cross axis is the axis perpendicular to the main axis in a flex container. The main axis is the axis along which flex items are placed in a flex container. The justify-content property sets how flex items are distributed along the main axis in a flex container. The height property sets the height of an element. The background-image property sets the image that fills the background of an element. The background-size property sets how the background image should be resized to fit the element’s dimensions. The background-position property sets how the background image should be positioned within the element’s boundaries. Here is the code snippet for the hero selector:</p><pre>/* Set the hero properties */<br>.hero {<br>    display: flex; /* This makes the hero element a flex container */<br>    flex-direction: column; /* This makes the flex items stack vertically */<br>    align-items: center; /* This makes the flex items align horizontally in the center */<br>    justify-content: space-evenly; /* This makes the flex items distribute evenly along the vertical axis */<br>    height: 80vh;<br>    background-image: url(&#39;https://images.unsplash.com/photo-1508615070457-7baeba4003e4?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=1350&amp;q=80&#39;);<br>    background-size: cover;<br>    background-position: center;<br>  }</pre><p>Then, let’s look at the hero h2 selector. This selector targets an &lt;h2&gt; element that is a descendant of an element with a className of “hero”. You can use a space between two selectors to select elements that are descendants of another element in CSS. A descendant is an element that is nested inside another element in the HTML structure. In this case, the hero h2 selector targets an &lt;h2&gt; element that is inside a &lt;div&gt; element with a className of “hero”. The hero h2 selector sets some styles for your hero title, such as color and font-family. The color property sets the color of the text in an element. The font-family property sets the font that is used for the text in an element. Here is the code snippet for the hero h2 selector:</p><pre>/* Set the hero h2 properties */<br>.hero h2 {<br>  color: var(--quaternary-color);<br>  font-family: &#39;Roboto Slab&#39;, serif;<br>}</pre><p>The hero button selector targets an &lt;button&gt; element that is a descendant of an element with a className of “hero”. You can use a space between two selectors to select elements that are descendants of another element in CSS. A descendant is an element that is nested inside another element in the HTML structure. In this case, the hero button selector targets an &lt;button&gt; element that is inside a &lt;div&gt; element with a className of “hero”. The hero button selector sets some styles for your hero button component, such as padding, border, border-radius, background-color, and color. The padding property sets the space around the content of an element. The border property sets the width, style, and color of the border around an element. The border-radius property sets how rounded the corners of an element are. The background-color property sets the color that fills the background of an element. The color property sets the color of the text in an element. Here is the code snippet for the hero button selector:</p><pre>/* Set the hero button properties */<br>.hero button {<br>  padding: 10px 20px;<br>  border: none;<br>  border-radius: 5px;<br>  background-color: var(--secondary-color);<br>  color: var(--quaternary-color);<br>}</pre><p>Next, let’s look at the hero button hover effect. This effect changes how an element looks when you hover over it with your mouse cursor. You can use a colon (:) followed by pseudo-classes to select elements based on their state or position in CSS. A pseudo-class is a keyword that represents a special state or position of an element. In this case, you can use :hover to select elements when they are hovered over by your mouse cursor. The hero button:hover selector targets an &lt;button&gt; element with a className of “hero” when it is hovered over by your mouse cursor. The hero button:hover selector sets some styles for your hero button component when it is hovered over, such as transform. The transform property applies a transformation to an element, such as scaling, rotating, skewing, or translating it. In this case, the transform property scales up the element by 10%. Here is the code snippet for the hero button hover effect:</p><pre>/* Set the hero button hover effect */<br>.hero button:hover {<br>  transform: scale(1.1);<br>}</pre><p>That’s it! You have defined two selectors: hero button and hero button:hover, and used them to style and add an effect to the button in the hero section of your website. I hope this explanation helps you understand the code better.</p><p>Last thing we need to do is go and change the App.tsx file to reflect the new components that we have:</p><pre>import React from &quot;react&quot;;<br>import &quot;./App.css&quot;;<br><br>import Main from &quot;./LandingPage/MainBody&quot;;<br>import Header from &quot;./LandingPage/Header&quot;;<br>import StandardFooter from &quot;./StandardFooter&quot;;<br><br>// Define the App component that renders the Header, Main, and Footer components<br>const App: React.FC = () =&gt; {<br>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;Header /&gt;<br>      &lt;Main /&gt;<br>      &lt;StandardFooter /&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>export default App;</pre><p>And with that we are done!</p><p>Our website looks like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*enGmjCMjzNUA6wdgTCu44w.png" /></figure><p>From here onwards, you can use this template in any which way you want.</p><p>I hope I have helped you in your React web dev learning career and hope you will achieve many great things with have we have learned today.</p><p>Thank you and good luck!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/0*RajhIFclhZUPayhV" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=132b92cc0dd5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>