<?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>Forem: Ko Htet</title>
    <description>The latest articles on Forem by Ko Htet (@kohtet_gintoki).</description>
    <link>https://forem.com/kohtet_gintoki</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%2F1578583%2Fa8577456-d370-4146-be8c-8ea87f2b2808.png</url>
      <title>Forem: Ko Htet</title>
      <link>https://forem.com/kohtet_gintoki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kohtet_gintoki"/>
    <language>en</language>
    <item>
      <title>Using Quill Rich Text Editor in the HTML Form element</title>
      <dc:creator>Ko Htet</dc:creator>
      <pubDate>Mon, 30 Sep 2024 04:59:56 +0000</pubDate>
      <link>https://forem.com/kohtet_gintoki/using-quill-rich-text-editor-in-the-html-form-element-2bh8</link>
      <guid>https://forem.com/kohtet_gintoki/using-quill-rich-text-editor-in-the-html-form-element-2bh8</guid>
      <description>&lt;h2&gt;
  
  
  Quill JS
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://quilljs.com/" rel="noopener noreferrer"&gt;Quill&lt;/a&gt; is a free, open-source WYSIWYG editor designed for the modern web.&lt;br&gt;
Let's use Quill js in form element. You can check the final HTML code at the bottom of this post. (￣y▽,￣)╭ &lt;/p&gt;
&lt;h2&gt;
  
  
  Create &lt;code&gt;index.html&lt;/code&gt;
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Document&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Add Bootstrap 5
&lt;/h2&gt;

&lt;p&gt;It is ok if you don't use Bootstrap.&lt;br&gt;
In &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"
    integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; at the bottom of the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
    integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
    crossorigin="anonymous"&amp;gt;&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's put some layout and form in &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="container"&amp;gt;
        &amp;lt;div class="m-5"&amp;gt;
        &amp;lt;h1 class="text-center"&amp;gt;HELLO&amp;lt;/h1&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;form action="https://httpbin.org/post" method="post"&amp;gt;
        &amp;lt;div class="mb-3"&amp;gt;
          &amp;lt;label for="title" class="form-label"&amp;gt;Title&amp;lt;/label&amp;gt;
          &amp;lt;input
            type="text"
            class="form-control"
            name="title"
            id="title"
            required
          /&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;button type="submit" class="btn btn-primary"&amp;gt;Add&amp;lt;/button&amp;gt;
        &amp;lt;a href="./" class="btn btn-dark"&amp;gt;Back&amp;lt;/a&amp;gt;
      &amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2Fpm1kw3iz1iqtw42o8q7j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fpm1kw3iz1iqtw42o8q7j.png" alt="title"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For the action, you can also use your own backend code like function.php. For now, I will use "&lt;a href="https://httpbin.org/post" rel="noopener noreferrer"&gt;https://httpbin.org/post&lt;/a&gt;".&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Quill Rich Text Editor
&lt;/h2&gt;

&lt;p&gt;Now, we will add Quill text editor. &lt;br&gt;
&lt;a href="https://quilljs.com/docs/quickstart" rel="noopener noreferrer"&gt;https://quilljs.com/docs/quickstart&lt;/a&gt;&lt;br&gt;
In &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;link href="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.snow.css" rel="stylesheet" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; at the bottom of the &lt;code&gt;&amp;lt;body&amp;gt;&lt;/code&gt; tag&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script src="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script&amp;gt;
  const quill = new Quill('#editor', {
    theme: 'snow'
  });
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;code&gt;&amp;lt;form&amp;gt;&lt;/code&gt; tag, add &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; for text editor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="mb-3"&amp;gt;
          &amp;lt;label for="des" class="form-label"&amp;gt;Content&amp;lt;/label&amp;gt;
          &amp;lt;div id="editor" class="form-control" name="des"&amp;gt;&amp;lt;/div&amp;gt;
 &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.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%2F4guvl4t3ejwk9xa8ynlz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2F4guvl4t3ejwk9xa8ynlz.png" alt="rte"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Send Post method for Quill text editor.
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  form.addEventListener("formdata", (event) =&amp;gt; {
          event.formData.append("des", quill.root.innerHTML);
        });
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add this code in &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tag. This append Quill content as html code before submitting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final index.html will look like this.
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
  &amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&amp;gt;
    &amp;lt;title&amp;gt;Document&amp;lt;/title&amp;gt;
    &amp;lt;link
      href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
      crossorigin="anonymous"
    /&amp;gt;
    &amp;lt;link
      href="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.snow.css"
      rel="stylesheet"
    /&amp;gt;
  &amp;lt;/head&amp;gt;
  &amp;lt;body&amp;gt;
    &amp;lt;div class="container"&amp;gt;
      &amp;lt;div class="m-5"&amp;gt;
        &amp;lt;h1 class="text-center"&amp;gt;HELLO&amp;lt;/h1&amp;gt;
      &amp;lt;/div&amp;gt;
      &amp;lt;form action="https://httpbin.org/post" method="post"&amp;gt;
        &amp;lt;div class="mb-3"&amp;gt;
          &amp;lt;label for="title" class="form-label"&amp;gt;Title&amp;lt;/label&amp;gt;
          &amp;lt;input
            type="text"
            class="form-control"
            name="title"
            id="title"
            required
          /&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;div class="mb-3"&amp;gt;
          &amp;lt;label for="des" class="form-label"&amp;gt;Content&amp;lt;/label&amp;gt;
          &amp;lt;div id="editor" class="form-control" name="des"&amp;gt;&amp;lt;/div&amp;gt;
        &amp;lt;/div&amp;gt;
        &amp;lt;button type="submit" class="btn btn-primary"&amp;gt;Add&amp;lt;/button&amp;gt;
        &amp;lt;a href="./" class="btn btn-dark"&amp;gt;Back&amp;lt;/a&amp;gt;
      &amp;lt;/form&amp;gt;
 &amp;lt;/div&amp;gt;
      &amp;lt;script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
        integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
        crossorigin="anonymous"
      &amp;gt;&amp;lt;/script&amp;gt;
      &amp;lt;script src="https://cdn.jsdelivr.net/npm/quill@2.0.2/dist/quill.js"&amp;gt;&amp;lt;/script&amp;gt;
      &amp;lt;script&amp;gt;
        const quill = new Quill("#editor", {
          theme: "snow",
        });
        const form = document.querySelector("form");
        form.addEventListener("formdata", (event) =&amp;gt; {
          event.formData.append("des", quill.root.innerHTML);
        });
      &amp;lt;/script&amp;gt;
  &amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Let's test the code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fxjw7exsnn6wf3dh8hhs8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fxjw7exsnn6wf3dh8hhs8.png" alt="test"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;a href="https://media.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%2Fxpv3cms7pgwlvyq3fxh5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fxpv3cms7pgwlvyq3fxh5.png" alt="output"&gt;&lt;/a&gt;&lt;br&gt;
Here, you can see the text is submitted with HTML code. &lt;/p&gt;

&lt;p&gt;Thank you for reading. (〜￣▽￣)〜&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>html</category>
    </item>
    <item>
      <title>15 Re-usable UI Component Libraries with Framer Motion</title>
      <dc:creator>Ko Htet</dc:creator>
      <pubDate>Fri, 20 Sep 2024 15:57:01 +0000</pubDate>
      <link>https://forem.com/kohtet_gintoki/15-re-usable-ui-component-libraries-with-framer-motion-25p9</link>
      <guid>https://forem.com/kohtet_gintoki/15-re-usable-ui-component-libraries-with-framer-motion-25p9</guid>
      <description>&lt;p&gt;Hello, This is the list of react components with framer motion that I have been using. All of these components are easy to use just by copy and paste. These components save me a lot of time and headaches when developing projects with animations. They are also customizable as they become your code after copy and paste into the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. &lt;a href="https://ui.aceternity.com" rel="noopener noreferrer"&gt;Aceternity UI&lt;/a&gt;
&lt;/h2&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%2Fact950f2v7qkpllk67bo.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%2Fact950f2v7qkpllk67bo.png" alt="Aceternity" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Aceternity is the most popular library by far, it has a lot of animated ui components ready to be used. &lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;a href="https://motion-primitives.com" rel="noopener noreferrer"&gt;Motion-primitives&lt;/a&gt;
&lt;/h2&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%2Fetculh39szxq3sujusol.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%2Fetculh39szxq3sujusol.png" alt="Motion-primitives" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Motion-primitives has decent animated ui components and update regularly. &lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;a href="https://ui.lukacho.com" rel="noopener noreferrer"&gt;Lukacho UI&lt;/a&gt;
&lt;/h2&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%2Faopb8lrag3vuaj8mgszq.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%2Faopb8lrag3vuaj8mgszq.png" alt="Lukacho" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Lukacho UI doesn't have many components like others but still, its components are pretty useful for quick development. &lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;a href="https://www.hover.dev" rel="noopener noreferrer"&gt;Hover.dev&lt;/a&gt;
&lt;/h2&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%2Fxvmp61vms7o3ro3tjxke.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%2Fxvmp61vms7o3ro3tjxke.png" alt="Hover" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Not all of Hover.dev components are free but its free components are enough to develop a beautiful animated website so you should check it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;a href="https://magicui.design/" rel="noopener noreferrer"&gt;Magic UI&lt;/a&gt;
&lt;/h2&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%2Fw30v5o8i7acc9upv9qm7.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%2Fw30v5o8i7acc9upv9qm7.png" alt="Magic" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Magic UI has a lot of cool animated components. I often use its text animations and special effects components in my projects. Magic UI is a library you should check after Aceternity UI. &lt;/p&gt;

&lt;h2&gt;
  
  
  6. &lt;a href="https://eldoraui.site/" rel="noopener noreferrer"&gt;Eldora UI&lt;/a&gt;
&lt;/h2&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%2Fwtnatjnvfdvfxfkbweww.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%2Fwtnatjnvfdvfxfkbweww.png" alt="Eldora ui" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Eldora Ui also has nice animated components and templates. Although, its "Cobe globe" lags a little when opening but others are fine, so no problem. &lt;/p&gt;

&lt;h2&gt;
  
  
  7. &lt;a href="https://www.ui-layouts.com" rel="noopener noreferrer"&gt;Ui-layout&lt;/a&gt;
&lt;/h2&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%2Fiwr3n1drtlrsxy28lbs5.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%2Fiwr3n1drtlrsxy28lbs5.png" alt="Ui-layout" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Components in Ui-layout are creative and beautiful. It is an amazing ui component library you should check out if you are looking for another cool library like Aceternity UI and Magic UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  8. &lt;a href="https://www.cult-ui.com/" rel="noopener noreferrer"&gt;Cult-ui&lt;/a&gt;
&lt;/h2&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%2Few5syuoz3f7x25wea5pk.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%2Few5syuoz3f7x25wea5pk.png" alt="Cult" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cult-ui is a collection of reusable components with the best use of framer motion and tailwind CSS. Like other libraries, it has a ton of animated components. &lt;/p&gt;

&lt;h2&gt;
  
  
  9. &lt;a href="https://animata.design/" rel="noopener noreferrer"&gt;Animata&lt;/a&gt;
&lt;/h2&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%2Fa4s6t1gjkgayrjt6arq7.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%2Fa4s6t1gjkgayrjt6arq7.png" alt="Animata" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Animata is also a reusable components collection of animations, effects, and interactions that you can use in your project with a simple copy and paste.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. &lt;a href="https://nyxbui.design/" rel="noopener noreferrer"&gt;Nyxbui&lt;/a&gt;
&lt;/h2&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%2F8h193vwj5lp47pie45jm.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%2F8h193vwj5lp47pie45jm.png" alt="Nyxbui" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A fusion of Shadcn and Magic Ui which is pretty cool if you are planning to use both in your project. &lt;/p&gt;

&lt;h2&gt;
  
  
  11. &lt;a href="https://www.edilozi.pro" rel="noopener noreferrer"&gt;Edilozi&lt;/a&gt;
&lt;/h2&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%2Fh6q43vld58w5syeh7f6r.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%2Fh6q43vld58w5syeh7f6r.png" alt="Edilozi" width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Edilozi has beautifully animated components and effects that you can copy and paste into your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  12. &lt;a href="https://variantvault.chrisabdo.dev" rel="noopener noreferrer"&gt;Variant Vault&lt;/a&gt;
&lt;/h2&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%2Fo8q58bl0c4bihcv1jdum.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%2Fo8q58bl0c4bihcv1jdum.png" alt="Variantvault" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Variant Vault has cool text animations with framer motion.&lt;/p&gt;

&lt;h2&gt;
  
  
  13. &lt;a href="https://www.codeui.co.in" rel="noopener noreferrer"&gt;CodeUi&lt;/a&gt;
&lt;/h2&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%2F5iezr6rdsvjkpxun11t9.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%2F5iezr6rdsvjkpxun11t9.png" alt="Codeui" width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CodeUi components library has eye-catching designs with animated components ready to be used. &lt;/p&gt;

&lt;h2&gt;
  
  
  14. &lt;a href="https://syntaxui.com/" rel="noopener noreferrer"&gt;Syntaxui&lt;/a&gt;
&lt;/h2&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%2Fdlipzzkgtijnflx1lmch.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%2Fdlipzzkgtijnflx1lmch.png" alt="Syntaxui" width="800" height="381"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SyntaxUi has simple minimalistic animated components for free. There is also a paid version called Syntaxui Pro. &lt;/p&gt;

&lt;h2&gt;
  
  
  15. &lt;a href="https://cuicui.day/" rel="noopener noreferrer"&gt;Cuicui&lt;/a&gt;
&lt;/h2&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%2Fnm9maqbrj3ilyuo8cbbn.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%2Fnm9maqbrj3ilyuo8cbbn.png" alt="Cuicui" width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cuicui has simple and straightforward components that you can easily use. You can easily understand how the components are made just by looking at the code. &lt;/p&gt;

&lt;p&gt;(〜￣▽￣)〜 &lt;/p&gt;

</description>
      <category>react</category>
      <category>ui</category>
      <category>frontend</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Creating a simple page router in PHP</title>
      <dc:creator>Ko Htet</dc:creator>
      <pubDate>Wed, 18 Sep 2024 04:57:14 +0000</pubDate>
      <link>https://forem.com/kohtet_gintoki/creating-a-simple-page-router-in-php-2hpf</link>
      <guid>https://forem.com/kohtet_gintoki/creating-a-simple-page-router-in-php-2hpf</guid>
      <description>&lt;h2&gt;
  
  
  Create files
&lt;/h2&gt;

&lt;p&gt;First, We will create &lt;code&gt;index.php&lt;/code&gt;, &lt;code&gt;router.php&lt;/code&gt;, and &lt;code&gt;.htaccess&lt;/code&gt; files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Redirect all requests to &lt;code&gt;index.php&lt;/code&gt; in &lt;code&gt;.htaccess&lt;/code&gt;
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,QSA]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Prevent from direct access for router.php
&lt;/h2&gt;

&lt;p&gt;This code will show a 404 response if the user enters the url for accessing &lt;code&gt;router.php&lt;/code&gt; directly.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
    http_response_code(404);
    die();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Add Page class in router.php
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Page
{
  protected static bool $Return_404 = true;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Create a static boolean variable for returning the 404 page. We will set it to true as default. &lt;br&gt;
Now we add a function for the 404 page.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protected static function Return_404(): void
    {
       (file_exists("./Pages/404.php")) ?  require_once "./Pages/404.php" : http_response_code(404);
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here, I put a 404 page inside the Pages folder. You can put it in any folder you want. &lt;/p&gt;

&lt;p&gt;We will also add the "File" function.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;protected static function File(string $file): string
{
    if (!empty($file)) {
        (str_contains($file, "?")) ? $file = strtok($file, '?') : $file;
        ($file[strlen($file) - 1] === "/") ? $file = rtrim($file, "/") : $file;
    }
    return $file;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This function will check if the request url contains a query string or ending with "/" and remove it.&lt;br&gt;
I use "&lt;a href="https://www.w3schools.com/php/func_string_strtok.asp" rel="noopener noreferrer"&gt;strtok&lt;/a&gt;" string function to get the string values before "?". I know "strtok" isn't meant to be used like this but it works and saves me from doing complex algorithms unnecessarily. I use "rtrim" string function to remove the "/" if it is contained at the last of the string. &lt;/p&gt;
&lt;h2&gt;
  
  
  Add Routes class in router.php
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Routes
{
    public static array $Route = array(
        "" =&amp;gt; "Pages/home.php",
        "/about" =&amp;gt; "Pages/about.php",
    );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Here, I create a static array for storing routings. &lt;br&gt;
This array contains "Requested url" =&amp;gt; "File location".&lt;br&gt;
I put all the page files in the Pages folder. You can put them anywhere you want.&lt;br&gt;
Note that &lt;code&gt;"" =&amp;gt; "Pages/home.php",&lt;/code&gt; is for the home page.&lt;/p&gt;
&lt;h2&gt;
  
  
  Add Router class in router.php
&lt;/h2&gt;

&lt;p&gt;The Router class will extend from the Page class that we already created above.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Router extends Page
{

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Now, we will write the function that checks whether the requested file exists in the Router class.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   public static function Run(): void
    {
        $requested_file = self::File($_SERVER["REQUEST_URI"]);
        foreach (Routes::$Route as $request =&amp;gt; $file) {
            if ($requested_file === $request) {
                if (file_exists($file)) {
                    self::$Return_404 = false;
                    require $file;
                } else echo "Error";
            }
        }
        if (self::$Return_404) self::Return_404();
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This function checks the requested file is in the $Route array first. If it exists, the static boolean $Return_404 is set to false so that the 404 page will not show and get the page file. If not exist, this will return the 404 page. &lt;br&gt;
If it exists but there is no file in the Pages folder, the function will echo "Error". You can show the 404 page instead of echo "Error" here.&lt;/p&gt;
&lt;h3&gt;
  
  
  The final router.php file will look like this.
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php
if (basename($_SERVER['PHP_SELF']) == basename(__FILE__)) {
    http_response_code(404);
    die();
}

class Page
{
    protected static bool $Return_404 = true;
    protected static function Return_404(): void
    {
        (file_exists("./Pages/404.php")) ?  require_once "./Pages/404.php" : http_response_code(404);
    }
    protected static function File(string $file): string
    {
        if (!empty($file)) {
            (str_contains($file, "?")) ? $file = strtok($file, '?') : $file;
            ($file[strlen($file) - 1] === "/") ? $file = rtrim($file, "/") : $file;
        }
        return $file;
    }
}
class Router extends Page
{
    public static function Run(): void
    {
        $requested_file = self::File($_SERVER["REQUEST_URI"]);
        foreach (Routes::$Route as $request =&amp;gt; $file) {
            if ($requested_file === $request) {
                if (file_exists($file)) {
                    self::$Return_404 = false;
                    require $file;
                } else echo "Error";
            }
        }
        if (self::$Return_404) self::Return_404();
    }
}
class Routes
{
    public static array $Route = array(
        "" =&amp;gt; "Pages/home.php",
        "/about" =&amp;gt; "Pages/about.php",
    );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h2&gt;
  
  
  Index.php
&lt;/h2&gt;

&lt;p&gt;In the index.php, we will use the "Run" function from the Router class.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html lang="en"&amp;gt;
&amp;lt;?php
require_once "./router.php";
?&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;meta charset="UTF-8"&amp;gt;
    &amp;lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&amp;gt;
    &amp;lt;title&amp;gt;Router&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;?php
    Router::Run();
    ?&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;All the HTML code from the pages will be in the "body" tag. &lt;/p&gt;
&lt;h2&gt;
  
  
  Create pages
&lt;/h2&gt;

&lt;p&gt;Finally, create home.php, about.php, and 404.php in the Pages folder.&lt;/p&gt;

&lt;p&gt;home.php&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;Home page&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;about.php&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;about page&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;404.php&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;h1&amp;gt;404 page&amp;lt;/h1&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Check if the code working or not with "&lt;a href="https://www.apachefriends.org/" rel="noopener noreferrer"&gt;xampp&lt;/a&gt;" or "&lt;a href="https://marketplace.visualstudio.com/items?itemName=brapifra.phpserver" rel="noopener noreferrer"&gt;PHP server&lt;/a&gt;" extension.&lt;/p&gt;

&lt;p&gt;If you encounter an error, feel free to tell me. XD&lt;/p&gt;

&lt;p&gt;You can also check the github repository at:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Tokigin" rel="noopener noreferrer"&gt;
        Tokigin
      &lt;/a&gt; / &lt;a href="https://github.com/Tokigin/page-router" rel="noopener noreferrer"&gt;
        page-router
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Manual router from php-router repository
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



</description>
      <category>php</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Using Aceternity UI in Astro</title>
      <dc:creator>Ko Htet</dc:creator>
      <pubDate>Thu, 05 Sep 2024 06:29:04 +0000</pubDate>
      <link>https://forem.com/kohtet_gintoki/using-aceternity-ui-in-astro-g4m</link>
      <guid>https://forem.com/kohtet_gintoki/using-aceternity-ui-in-astro-g4m</guid>
      <description>&lt;p&gt;I really like to use Aceternity Ui in Nextjs but sometime, I don't really need Nextjs to develop a project. About half of my new projects are done in Astro SSG. So, I thought, why not use Aceternity Ui in Astro.&lt;/p&gt;

&lt;p&gt;Astro is an open-source web framework that allows developers to create fast and lightweight websites. My personally favorite is that Astro can support React, Preact, Svelte, Vue, Solid, Lit, HTMX, web components, and more. It is Zero JS, by default and customizable.&lt;/p&gt;

&lt;p&gt;For this, we will take advantage of using &lt;strong&gt;Astro&lt;/strong&gt; with &lt;strong&gt;React&lt;/strong&gt; and of course, &lt;strong&gt;TypeScript&lt;/strong&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Firstly, we will create an Astro project using &lt;a href="https://bun.sh/" rel="noopener noreferrer"&gt;Bun&lt;/a&gt;. If you are not using Bun, don't worry. You can still use NPM instead of Bun. &lt;/p&gt;

&lt;p&gt;We will start creating a project with Astro CLI.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Creating Astro Project
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

bun create astro@latest


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


dir   Where should we create your new project?
         ./project-name

tmpl   How would you like to start your new project?
         Empty

ts   Do you plan to write TypeScript?
         Yes

use   How strict should TypeScript be?
         Strict

deps   Install dependencies?
         Yes

git   Initialize a new git repository?
         No



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;cd &lt;/span&gt;project-name


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  2. Add React
&lt;/h3&gt;

&lt;p&gt;If you are using &lt;strong&gt;npm&lt;/strong&gt;, use &lt;strong&gt;npx&lt;/strong&gt; instead of &lt;strong&gt;bunx&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

bunx astro add react


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Answer &lt;code&gt;Yes&lt;/code&gt; to all the questions.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Add Tailwind
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

bunx astro add tailwind


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Answer &lt;code&gt;Yes&lt;/code&gt; to all the questions.&lt;/p&gt;

&lt;p&gt;Add the following code to the &lt;strong&gt;tsconfig.json&lt;/strong&gt; file to resolve paths:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

{
  "compilerOptions": {
    // ...
    "baseUrl": ".",
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
    // ...
  }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Import the &lt;code&gt;globals.css&lt;/code&gt; file in the &lt;code&gt;@/pages/index.astro&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

---
import '@/styles/globals.css'
---


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Update &lt;code&gt;tailwind()&lt;/code&gt; in &lt;code&gt;astro.config.mjs&lt;/code&gt; :&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

export default defineConfig({
  integrations: [
    //your code,
    tailwind({
      applyBaseStyles: false,
    }),
  ],
})


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Update &lt;code&gt;tailwind.config.mjs&lt;/code&gt; :&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

export default {
//your code,
  content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
}



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  4. Install Shardcn Ui
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Aceternity Ui&lt;/strong&gt; is based on &lt;strong&gt;Shardcn Ui&lt;/strong&gt;. So we will need to install Shardcn in the project. Luckily, Shardcn provides installation for Astro. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

bunx shadcn@latest init


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;There is still no error after running this command with bun but if you are using npm, there may be an error like this. (&lt;a href="https://github.com/Tokigin/astro-aceternity/issues/2" rel="noopener noreferrer"&gt;#issue&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.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%2Fr3kgq1zefc4rva5i1u44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.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%2Fr3kgq1zefc4rva5i1u44.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To fix this error, you have to create a folder named "npm" in "AppData\Roaming". &lt;br&gt;
There are two ways to create the folder. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open PowerShell and enter &lt;code&gt;New-Item -Path "$env:APPDATA\npm" -ItemType Directory&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Open Run command window, enter &lt;code&gt;%appdata%&lt;/code&gt; and create a folder named "npm".&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After that, you can continue the process below. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

√ Would you like to use TypeScript (recommended)? ... yes
√ Which style would you like to use? » Default
√ Which color would you like to use as base color? » Slate
√ Where is your global CSS file? ... ./src/styles/globals.css
√ Would you like to use CSS variables for colors? ... no
√ Are you using a custom tailwind prefix eg. tw-? (Leave blank if not) ...
√ Where is your tailwind.config.js located? ... tailwind.config.mjs
√ Configure the import alias for components: ... @/components
√ Configure the import alias for utils: ... @/lib/utils
√ Are you using React Server Components? ... no
√ Write configuration to components.json. Proceed? ... yes


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  5. Install Framer Motion
&lt;/h3&gt;

&lt;p&gt;Finally, install &lt;strong&gt;Framer Motion&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

bun i framer-motion clsx tailwind-merge


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  6. Add Aceternity Ui component
&lt;/h3&gt;

&lt;p&gt;After installing &lt;strong&gt;Framer Motion&lt;/strong&gt;, we can basically use &lt;strong&gt;Aceternity&lt;/strong&gt; component in our project but there are a few adjustments that need to done. &lt;/p&gt;

&lt;p&gt;Now we will add &lt;strong&gt;3d-card&lt;/strong&gt; from &lt;strong&gt;Aceternity&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

bunx aceternity-ui@latest add 3d-card


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;In &lt;strong&gt;3d-card.tsx&lt;/strong&gt; , remove &lt;code&gt;"use client";&lt;/code&gt; as it is from Nextjs. We are using Astro so we don't need Nextjs Syntax.&lt;/p&gt;

&lt;p&gt;Remove &lt;code&gt;import Image from "next/image";&lt;/code&gt; and use normal &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; tag.&lt;/p&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;p&gt;Replace it with &lt;code&gt;import { Image } from 'astro:assets';&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  7. Using Aceternity Ui component
&lt;/h3&gt;

&lt;p&gt;After adding the component, we can now use the Aceternity component.&lt;br&gt;
I will skip writing the code from scratch so I will copy and paste from the example. &lt;/p&gt;

&lt;p&gt;Create &lt;code&gt;threedcarddemo.tsx&lt;/code&gt; in &lt;code&gt;"@/components/"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Copy and Paste the code from &lt;a href="https://ui.aceternity.com/components/3d-card-effect" rel="noopener noreferrer"&gt;https://ui.aceternity.com/components/3d-card-effect&lt;/a&gt; example.&lt;/p&gt;

&lt;p&gt;Remove these lines because we don't need them in Astro :&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

"use client";
import Image from "next/image";
import React from "react";


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Import component in the &lt;code&gt;@/pages/index.astro&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

---
import { ThreeDCardDemo } from "@/components/threedcarddemo";
---


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;You can use &lt;code&gt;client:idle&lt;/code&gt; or &lt;code&gt;client:load&lt;/code&gt; as you like.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;ThreeDCardDemo client:idle /&amp;gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;I hope you encounter no error during the process. &lt;br&gt;
Thank you for reading. :D&lt;/p&gt;

&lt;p&gt;You can check my github repository at: &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Tokigin" rel="noopener noreferrer"&gt;
        Tokigin
      &lt;/a&gt; / &lt;a href="https://github.com/Tokigin/astro-aceternity" rel="noopener noreferrer"&gt;
        astro-aceternity
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Using Aceternity ui in Astro project 
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Astro + Aceternity&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;I really like to use Aceternity Ui in Nextjs but sometime, I don't really need Nextjs to develop a project. About half of my new projects are done in Astro SSG. So, I thought, why not use Aceternity Ui in Astro.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Reference&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;&lt;a href="https://docs.astro.build/en/install-and-setup" rel="nofollow noopener noreferrer"&gt;https://docs.astro.build/en/install-and-setup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.framer.com/motion/introduction" rel="nofollow noopener noreferrer"&gt;https://www.framer.com/motion/introduction&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ui.shadcn.com/docs/installation/astro" rel="nofollow noopener noreferrer"&gt;https://ui.shadcn.com/docs/installation/astro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ui.aceternity.com/docs/add-utilities" rel="nofollow noopener noreferrer"&gt;https://ui.aceternity.com/docs/add-utilities&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;I use &lt;a href="https://bun.sh/" rel="nofollow noopener noreferrer"&gt;Bun&lt;/a&gt; here but you can use npm or npx.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. Creating Astro Project&lt;/h3&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;bun create astro@latest&lt;/pre&gt;

&lt;/div&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;
dir   Where should we create your new project?
         ./project-name

tmpl   How would you like to start your new project?
         Empty

ts   Do you plan to write TypeScript?
         Yes

use   How strict should TypeScript be?
         Strict

deps   Install dependencies?
         Yes

git   Initialize a new git repository?
         No

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c1"&gt;cd&lt;/span&gt; project-name&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;2. Add React&lt;/h3&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;bunx astro add react&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Answer &lt;code&gt;Yes&lt;/code&gt; to all the questions.&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;3. Add Tailwind&lt;/h3&gt;

&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;bunx astro add tailwind&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Answer &lt;code&gt;Yes&lt;/code&gt; to all the questions.&lt;/p&gt;

&lt;p&gt;Add the following code to the tsconfig.json file…&lt;/p&gt;
&lt;/div&gt;


&lt;/div&gt;
&lt;br&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Tokigin/astro-aceternity" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;


&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://docs.astro.build/en/install-and-setup" rel="noopener noreferrer"&gt;https://docs.astro.build/en/install-and-setup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.framer.com/motion/introduction" rel="noopener noreferrer"&gt;https://www.framer.com/motion/introduction&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ui.shadcn.com/docs/installation/astro" rel="noopener noreferrer"&gt;https://ui.shadcn.com/docs/installation/astro&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ui.aceternity.com/docs/add-utilities" rel="noopener noreferrer"&gt;https://ui.aceternity.com/docs/add-utilities&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>astro</category>
      <category>react</category>
      <category>ui</category>
    </item>
  </channel>
</rss>
