<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Elliot Sutton</title>
    <description>The latest articles on DEV Community by Elliot Sutton (@skyleen).</description>
    <link>https://dev.to/skyleen</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%2F2882186%2F91a85f1a-bb24-4d6e-ac3a-d1b7bbb7c2ca.png</url>
      <title>DEV Community: Elliot Sutton</title>
      <link>https://dev.to/skyleen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/skyleen"/>
    <language>en</language>
    <item>
      <title>Shadcn Components Animated with Motion (and More!)</title>
      <dc:creator>Elliot Sutton</dc:creator>
      <pubDate>Mon, 31 Mar 2025 10:33:56 +0000</pubDate>
      <link>https://dev.to/skyleen/shadcn-components-animated-with-motion-and-more-11l7</link>
      <guid>https://dev.to/skyleen/shadcn-components-animated-with-motion-and-more-11l7</guid>
      <description>&lt;p&gt;Are you looking to supercharge your Shadcn components with fluid, modern animations?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Animate UI&lt;/strong&gt; is an open-source distribution that &lt;strong&gt;animates&lt;/strong&gt; &lt;a href="https://ui.shadcn.com" rel="noopener noreferrer"&gt;Shadcn/ui&lt;/a&gt; with &lt;a href="https://motion.dev" rel="noopener noreferrer"&gt;Motion&lt;/a&gt;—while retaining all the power and accessibility of &lt;strong&gt;Radix&lt;/strong&gt; primitives.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shadcn Animated Components
&lt;/h2&gt;

&lt;p&gt;Animate UI elevates your Shadcn components by bringing &lt;strong&gt;smooth transitions&lt;/strong&gt; and &lt;strong&gt;engaging micro-interactions&lt;/strong&gt; to every element. Whether you’re working with an Accordion, Checkbox, or Dialog, each component feels more &lt;strong&gt;intuitive&lt;/strong&gt; and &lt;strong&gt;responsive&lt;/strong&gt;. The collection is constantly growing, and all components can be &lt;strong&gt;copied&lt;/strong&gt;, &lt;strong&gt;customized&lt;/strong&gt;, and &lt;strong&gt;dropped&lt;/strong&gt; straight into your project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond Shadcn
&lt;/h2&gt;

&lt;p&gt;In addition to Radix-based primitives, Animate UI offers a variety of other &lt;strong&gt;animated elements&lt;/strong&gt; like text effects, background transitions, and more. These additions help you maintain a &lt;strong&gt;cohesive design language&lt;/strong&gt; across your entire interface, creating a &lt;strong&gt;polished&lt;/strong&gt;, &lt;strong&gt;on-trend&lt;/strong&gt; experience for users.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Distribution, Not a Library
&lt;/h2&gt;

&lt;p&gt;Animate UI follows the &lt;a href="https://ui.shadcn.com/docs/cli" rel="noopener noreferrer"&gt;Shadcn CLI&lt;/a&gt; approach, meaning you &lt;strong&gt;copy source files&lt;/strong&gt; directly into your codebase rather than installing a package. This gives you &lt;strong&gt;full ownership&lt;/strong&gt;—no hidden overrides or rigid constraints. It also integrates &lt;strong&gt;smoothly&lt;/strong&gt; with other component distributions like &lt;strong&gt;Shadcn&lt;/strong&gt;, &lt;strong&gt;Magic UI&lt;/strong&gt;, and more, enhancing rather than replacing your existing setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Started
&lt;/h2&gt;

&lt;p&gt;Ready to see your UI come alive?&lt;/p&gt;

&lt;p&gt;Visit &lt;a href="https://animate-ui.com" rel="noopener noreferrer"&gt;animate-ui.com&lt;/a&gt; to explore the available components and discover how Animate UI can &lt;strong&gt;transform&lt;/strong&gt; your React projects. Whether you love Shadcn or simply want &lt;strong&gt;top-notch animations&lt;/strong&gt;, Animate UI offers a &lt;strong&gt;flexible&lt;/strong&gt;, &lt;strong&gt;easy-to-adapt&lt;/strong&gt; solution that makes every &lt;strong&gt;interaction&lt;/strong&gt; stand out!&lt;/p&gt;

</description>
      <category>shadcn</category>
      <category>ui</category>
      <category>motion</category>
      <category>react</category>
    </item>
    <item>
      <title>🚀 A Better Way to Manage Middlewares in Next.js</title>
      <dc:creator>Elliot Sutton</dc:creator>
      <pubDate>Tue, 18 Feb 2025 20:46:13 +0000</pubDate>
      <link>https://dev.to/skyleen/a-better-way-to-manage-middlewares-in-nextjs-5d8o</link>
      <guid>https://dev.to/skyleen/a-better-way-to-manage-middlewares-in-nextjs-5d8o</guid>
      <description>&lt;h2&gt;
  
  
  📌 Why Rethink Middleware Management?
&lt;/h2&gt;

&lt;p&gt;Next.js provides a &lt;strong&gt;simple and efficient middleware system&lt;/strong&gt;, but it comes with a major limitation: there is only one &lt;code&gt;middleware.ts&lt;/code&gt; file for the entire application.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚠️ Limitations of Next.js Middleware
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;❌ &lt;strong&gt;A single global middleware&lt;/strong&gt; → Impossible to have multiple independent middlewares.&lt;/li&gt;
&lt;li&gt;❌ &lt;strong&gt;Growing complexity&lt;/strong&gt; → All logic must be merged into a single file.&lt;/li&gt;
&lt;li&gt;❌ &lt;strong&gt;Difficulties integrating some libraries&lt;/strong&gt; → Hard to use multiple external middlewares without manual merging.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is where &lt;strong&gt;Next MW&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;Next MW&lt;/strong&gt; is a lightweight and flexible library that allows you to &lt;strong&gt;compose multiple middlewares&lt;/strong&gt; and execute them &lt;strong&gt;independently and sequentially&lt;/strong&gt;, while maintaining full compatibility with Next.js.&lt;/p&gt;

&lt;p&gt;Instead of struggling with a bloated &lt;code&gt;middleware.ts&lt;/code&gt; file, you can define your middlewares separately and combine them cleanly.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✅ Next MW: Modular and Flexible Middleware Management
&lt;/h3&gt;

&lt;p&gt;With &lt;strong&gt;Next MW&lt;/strong&gt;, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Define multiple independent middlewares&lt;/strong&gt;, each with its own configuration.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Execute them sequentially&lt;/strong&gt;, without hacks or workarounds.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Maintain full compatibility with Next.js&lt;/strong&gt; and its matchers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚀 Quick Installation
&lt;/h2&gt;

&lt;p&gt;Install &lt;strong&gt;Next MW&lt;/strong&gt; with your preferred package manager:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;next-mw
&lt;span class="c"&gt;# or&lt;/span&gt;
yarn add next-mw
&lt;span class="c"&gt;# or&lt;/span&gt;
pnpm add next-mw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔔 Note: Requires Next.js &lt;code&gt;&amp;gt;=13.1.0&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Example Use Case
&lt;/h2&gt;

&lt;p&gt;This example illustrates how &lt;strong&gt;Next MW&lt;/strong&gt; allows you to &lt;strong&gt;organize multiple middlewares cleanly&lt;/strong&gt; in a Next.js project by combining &lt;strong&gt;NextAuth v5 and next-intl&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  📁 File Organization
&lt;/h3&gt;

&lt;p&gt;Instead of keeping everything in &lt;code&gt;middleware.ts&lt;/code&gt;, you can structure your files like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;📂 middlewares
 ├── auth.ts         (NextAuth v5 middleware)
 ├── next-intl.ts    (next-intl middleware)
📄 middleware.ts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, in &lt;code&gt;middleware.ts&lt;/code&gt;, simply compose them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// middleware.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;middlewares&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-mw&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;nextIntl&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./middlewares/next-intl&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;authMiddleware&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./middlewares/auth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;middleware&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;middlewares&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nextIntl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;authMiddleware&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  🏗️ Illustrative Middlewares
&lt;/h3&gt;

&lt;p&gt;Here are two commonly used middlewares in a &lt;strong&gt;Next.js&lt;/strong&gt; project, which &lt;strong&gt;Next MW&lt;/strong&gt; allows you to neatly combine.&lt;/p&gt;

&lt;h4&gt;
  
  
  🔑 NextAuth v5 Middleware
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// middlewares/auth.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;authConfig&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../auth.config&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;NextAuth&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-auth&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;middleware&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;NextAuth&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;authConfig&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  🌍 next-intl Middleware
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// middlewares/next-intl.ts&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;createMiddleware&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;next-intl/middleware&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;routing&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;../i18n/routing&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;middleware&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;createMiddleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;routing&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;matcher&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/(fr|en)/:path*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🎯 Why Use Next MW?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Full modularity →&lt;/strong&gt; Each middleware remains independent.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Sequential execution →&lt;/strong&gt; Maintains a controlled execution order.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Fully compatible with Next.js →&lt;/strong&gt; Uses the native system.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Easy integration →&lt;/strong&gt; No hacks or complex setups required.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Works with both App and Pages directories →&lt;/strong&gt; Universal compatibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With &lt;strong&gt;Next MW&lt;/strong&gt;, middleware management &lt;strong&gt;becomes cleaner, more flexible, and easier to maintain&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  📌 Useful Links
&lt;/h2&gt;

&lt;p&gt;📦 &lt;a href="https://www.npmjs.com/package/next-mw" rel="noopener noreferrer"&gt;NPM Package&lt;/a&gt;&lt;br&gt;
🖥️ &lt;a href="https://github.com/Skyleen77/next-mw" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;br&gt;
🌍 &lt;a href="https://next-mw-docs.vercel.app" rel="noopener noreferrer"&gt;Documentation &amp;amp; Website&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try Next MW today and simplify your Next.js middleware management! 🚀&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🗨️ Your Feedback Matters!
&lt;/h2&gt;

&lt;p&gt;Do you use multiple middlewares in your Next.js project? Would Next MW help you? Share your experience in the comments! 💬&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>nextjs</category>
      <category>react</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
