<?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 Patrick Valer on Medium]]></title>
        <description><![CDATA[Stories by Patrick Valer on Medium]]></description>
        <link>https://medium.com/@patrickvaler?source=rss-d03e20eb395f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TSnTh4lOzK6E-DfuY8wgIQ.png</url>
            <title>Stories by Patrick Valer on Medium</title>
            <link>https://medium.com/@patrickvaler?source=rss-d03e20eb395f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 20:37:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@patrickvaler/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[Claude Code Can Read Your SSH Keys. Mine Can’t.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@patrickvaler/claude-code-can-read-your-ssh-keys-mine-cant-373ab5e523c7?source=rss-d03e20eb395f------2"><img src="https://cdn-images-1.medium.com/max/1500/1*ValQnDdQ27qzBy2UG_oQuQ.png" width="1500"></a></p><p class="medium-feed-snippet">Why I run every Claude Code project inside a dev container, and how you can set the same thing up.</p><p class="medium-feed-link"><a href="https://medium.com/@patrickvaler/claude-code-can-read-your-ssh-keys-mine-cant-373ab5e523c7?source=rss-d03e20eb395f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@patrickvaler/claude-code-can-read-your-ssh-keys-mine-cant-373ab5e523c7?source=rss-d03e20eb395f------2</link>
            <guid isPermaLink="false">https://medium.com/p/373ab5e523c7</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[Patrick Valer]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 19:24:50 GMT</pubDate>
            <atom:updated>2026-07-25T19:24:50.606Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[/compact — the most expensive keystroke in Claude Code]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@patrickvaler/compact-the-most-expensive-keystroke-in-claude-code-8a93d2526efe?source=rss-d03e20eb395f------2"><img src="https://cdn-images-1.medium.com/max/2400/1*MvHe0rlj15OAHkBQgLcUiQ.png" width="2400"></a></p><p class="medium-feed-snippet">And you press it at the worst possible moment: right after your plan is finished. Here&apos;s what it costs you, and what to do instead.</p><p class="medium-feed-link"><a href="https://medium.com/@patrickvaler/compact-the-most-expensive-keystroke-in-claude-code-8a93d2526efe?source=rss-d03e20eb395f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@patrickvaler/compact-the-most-expensive-keystroke-in-claude-code-8a93d2526efe?source=rss-d03e20eb395f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8a93d2526efe</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[claude]]></category>
            <dc:creator><![CDATA[Patrick Valer]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 14:07:41 GMT</pubDate>
            <atom:updated>2026-07-25T14:07:41.218Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Treating Your Dotfiles Like Production Code]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@patrickvaler/treating-your-dotfiles-like-production-code-e33df4a0fbdb?source=rss-d03e20eb395f------2"><img src="https://cdn-images-1.medium.com/max/2600/1*eyM_kv_UflRRJSLD63TNog.jpeg" width="3333"></a></p><p class="medium-feed-snippet">Imagine your laptop dies today. Not a backup failure, the hardware is just
gone.</p><p class="medium-feed-link"><a href="https://medium.com/@patrickvaler/treating-your-dotfiles-like-production-code-e33df4a0fbdb?source=rss-d03e20eb395f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@patrickvaler/treating-your-dotfiles-like-production-code-e33df4a0fbdb?source=rss-d03e20eb395f------2</link>
            <guid isPermaLink="false">https://medium.com/p/e33df4a0fbdb</guid>
            <category><![CDATA[dotfiles]]></category>
            <category><![CDATA[local-environment]]></category>
            <category><![CDATA[zsh]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[shell]]></category>
            <dc:creator><![CDATA[Patrick Valer]]></dc:creator>
            <pubDate>Wed, 08 Jul 2026 14:31:12 GMT</pubDate>
            <atom:updated>2026-07-08T15:06:06.892Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to get started with shadcn/ui and Next.js within a Nx Monorepo]]></title>
            <link>https://medium.com/@patrickvaler/how-to-get-started-with-shadcn-ui-and-next-js-within-a-nx-monorepo-57908f48b4ef?source=rss-d03e20eb395f------2</link>
            <guid isPermaLink="false">https://medium.com/p/57908f48b4ef</guid>
            <category><![CDATA[shadcn]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[nx]]></category>
            <dc:creator><![CDATA[Patrick Valer]]></dc:creator>
            <pubDate>Wed, 22 Nov 2023 21:51:54 GMT</pubDate>
            <atom:updated>2024-02-17T18:36:42.214Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*g7qV1C4Y5AA-pCGb04KLJQ.png" /></figure><p>In today’s blog post, we’re diving into the exciting world of <a href="https://nextjs.org/">Next.js</a> and <a href="https://nx.dev/">Nx Monorepo</a>, combining with the fantastic <a href="https://ui.shadcn.com/">Shadcn UI library</a>.</p><p>By the end of this article, you will grasp the process of establishing a shared component library using Shadcn UI within an Nx Monorepo, seamlessly integrated within one or more Next.js applications.</p><p>The source code is available and free to use on <a href="https://github.com/patrickvaler/nx-next-shadcn-ui-starter">this GitHub repository</a>. In addition, each individual step is available as a <a href="https://github.com/patrickvaler/nx-next-shadcn-ui-starter/branches">branch</a>.</p><blockquote><strong><em>Update: <br></em></strong><em>Meanwhile, GitHub user </em><a href="https://github.com/TriPSs"><em>TriPSs</em></a><em> has developed an Nx plugin named </em><a href="https://github.com/TriPSs/nx-extend/tree/master/packages/shadcn-ui"><em>@nx-extend/shadcn-ui</em></a><em> following the guidelines outlined in this article.</em></blockquote><h3>What is shadcn/ui?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1nDJyLe87LD9wlXnWlnjkw.png" /><figcaption>shadcn/ui dashboard components</figcaption></figure><p><a href="https://ui.shadcn.com/">Shadcn UI</a> isn’t your typical component library or UI framework. As per the documentation, it’s aptly described as “a collection of reusable components that we can copy and paste into our apps.” This innovative concept was conceived by Shadcn, the mastermind behind notable open-source projects such as Taxonomy, Next.js for Drupal, and Reflexjs.</p><p>Built on top of Tailwind CSS and Radix UI, Shadcn UI seamlessly supports popular frameworks like Next.js, Gatsby, Remix, Astro, Laravel, and Vite. However, its flexibility extends beyond these boundaries, with a comprehensive guide available for manual integration into other technologies.</p><p>Despite being unveiled just a few months ago, Shadcn UI has rapidly emerged as one of the most viral UI solutions in the web development ecosystem. Its popularity has soared, with developers across the globe adopting and praising its unique approach. Notably, even industry leaders like Vercel have joined the conversation, recognizing the impact and potential of Shadcn UI. At the time of writing, it boasts an impressive 35.7k GitHub stars.</p><h4>Benefits of shadcn/ui</h4><p>Shadcn UI offers a multitude of advantages when compared to other component libraries.</p><blockquote>Beautifully designed components that you can copy and paste into your apps (or generate via cli). Accessible. Customizable. Open Source.</blockquote><p>Let’s explore the key highlights:</p><ul><li><strong>Easy to use:</strong> Getting started with Shadcn UI is a breeze for anyone with a foundational understanding of HTML, CSS, JavaScript, and familiarity with a framework or two. Accessing its components is as simple as utilizing the copy-and-paste method or opting for a quick installation via the command line interface.</li><li><strong>a11y-ready: </strong>Shadcn UI’s components are designed with full accessibility in mind, aligning seamlessly with the Web Content Accessibility Guidelines standards. It robustly supports features such as screen readers, keyboard navigation, and other accessibility tools. With Shadcn UI, you can craft applications that not only boast aesthetic appeal but are also accessible to users of all abilities.</li><li><strong>Light/Dark Mode capabilities:</strong> Shadcn UI works out of the box with light and dark mode.</li><li><strong>Open Source:</strong> Shadcn UI is open sources and well backed by the community.</li></ul><h3>Getting started</h3><p>This article is dedicated to guiding the implementation of Shadcn UI with Next.js within an Nx Monorepo.</p><h4>Step 1: Create Nx Workspace with Next.js application</h4><p>To initiate the process, generate a new Nx Workspace by executing the command below:</p><pre>npx create-nx-workspace nx-next-shadcn-ui-starter --appName=web-app --style=css --preset=next --e2eTestRunner=playwright --nxCloud=true --nextAppDir=true</pre><p>This command generates a Nx workspace with the name nx-next-shadcn-ui-starter and a Next.js application with app router using css styles. Nx Cloud Caching will be enabled and playwright is used for e2e testing.</p><h4>Step 2: Add tailwind support</h4><p>Add tailwind support for the recently generated web-app :</p><pre>npx nx g @nx/react:setup-tailwind --project=web-app</pre><p>This will create or update following files:</p><pre>CREATE apps/web-app/postcss.config.js<br>CREATE apps/web-app/tailwind.config.js<br>UPDATE apps/web-app/app/global.css<br>UPDATE package.json</pre><h4>Step 3: Create shared ui components library</h4><p>Let’s create a library that we can later utilize for our shadcn/ui components:</p><pre>npx nx generate @nx/next:library ui --directory=libs/ui-kit --importPath=@nx-next-shadcn-ui-starter/ui-kit/ui --bundler=swc --style=cssThis will generate:</pre><p>You’ll get ask regarding the Name and Root , ensure you select these values:</p><pre>Name: ui-kit-ui<br>Root: libs/ui-kit/ui</pre><ul><li>A new library called ui in path libs/ui-kit/ui will be generated</li><li>Components will be importable by path @nx-next-shadcn-ui-starter/ui-kit/ui</li></ul><p>After creating the shared component library, perform the following steps:</p><ol><li>Remove libs/ui-kit/ui/src/server.ts (not used)</li><li>Remove all files withing libs/ui-kit/ui/src/lib/* (not used)</li><li>Remove .@nx-next-shadcn-ui-starter/ui-kit/ui/server path in .tsconfig.base.json on root level (we removed the source file in step 1)</li><li>Ensure exports in libs/ui-kit/ui/src/index.ts have been removed (the exported files have been removed in step 2)</li></ol><p>Now, you should have an empty library ready for use, that we will later utilize to generate shadcn/ui components.</p><h4>Step 4: Create shared utilities library</h4><p>Now we prepare a shared util library that we can utilize later for our shadcn/ui utilities (like classname function ):</p><pre>npx nx generate @nx/js:library util --directory=libs/ui-kit --importPath=@nx-next-shadcn-ui-starter/ui-kit/util --bundler=swc --unitTestRunner=jest</pre><p>You’ll get ask regarding the Name and Root , ensure you select these values:</p><pre>Name: ui-kit-util<br>Root: libs/ui-kit/util</pre><ul><li>A new library called util in path libs/ui-kit/util will be generated</li><li>Utilities will be importable by path @nx-next-shadcn-ui-starter/ui-kit/util</li></ul><p>After creating the shared utilities library, perform the following steps:</p><ol><li>Remove all files within libs/ui-kit/util/src/lib/* (not necessary)</li><li>Ensure exports in libs/ui-kit/utili/src/index.ts have been removed (not necessary as we removed them in step 1)</li></ol><p>Now, you should have an empty library ready for use, that we will later utilize to add our utility functionalities.</p><h4>Step 5: Add dependencies needed by shadcn/ui</h4><p>Install all 3rd party packages needed by shadcn/ui:</p><pre>npm install @radix-ui/react-icons tailwindcss-animate class-variance-authority clsx tailwind-merge </pre><h4>Step 6: Add “shared” tailwind config</h4><p>The typical location for tailwind.config.js is within the source folder of the application. To share this configuration shadcn/ui and the application in our setup, we will make the tailwind.config.js file shareable from @nx-next-shadcn-ui-starter/ui-kit/util.</p><p><strong>Note: </strong>This step is optional, you can also include it at the app level. However, it’s a good idea to share these settings if you intend to use them for multiple applications.</p><p><strong>Add shared tailwind.config.js file</strong></p><ul><li>Add tailwind folder in libs/ui-kit/util/src</li><li>Add tailwind.config.js in libs/ui-kit/util/src/tailwind to extend theme configurationwith css variables (will be applied in next step)</li></ul><pre>// libs/ui-kit/util/src/tailwind/tailwind.config.js<br><br>const { join } = require(&#39;path&#39;);<br><br>const defaultTheme = require(&#39;tailwindcss/defaultTheme&#39;);<br>const TailwindAnimate = require(&#39;tailwindcss-animate&#39;);<br><br>module.exports = {<br>  content: [<br>    // relative path by consumer app<br>    &#39;./{app,pages,components}/**/*.{js,jsx,ts,tsx}&#39;,<br>    // path to ui-kit components (relative to current dir)<br>    join(__dirname, &#39;../../../ui/**/*.{js,jsx,ts,tsx}&#39;),<br>  ],<br>  theme: {<br>    extend: {<br>      colors: {<br>        border: &#39;hsl(var(--border))&#39;,<br>        input: &#39;hsl(var(--input))&#39;,<br>        ring: &#39;hsl(var(--ring))&#39;,<br>        background: &#39;hsl(var(--background))&#39;,<br>        foreground: &#39;hsl(var(--foreground))&#39;,<br>        primary: {<br>          DEFAULT: &#39;hsl(var(--primary))&#39;,<br>          foreground: &#39;hsl(var(--primary-foreground))&#39;,<br>        },<br>        secondary: {<br>          DEFAULT: &#39;hsl(var(--secondary))&#39;,<br>          foreground: &#39;hsl(var(--secondary-foreground))&#39;,<br>        },<br>        destructive: {<br>          DEFAULT: &#39;hsl(var(--destructive))&#39;,<br>          foreground: &#39;hsl(var(--destructive-foreground))&#39;,<br>        },<br>        muted: {<br>          DEFAULT: &#39;hsl(var(--muted))&#39;,<br>          foreground: &#39;hsl(var(--muted-foreground))&#39;,<br>        },<br>        accent: {<br>          DEFAULT: &#39;hsl(var(--accent))&#39;,<br>          foreground: &#39;hsl(var(--accent-foreground))&#39;,<br>        },<br>        popover: {<br>          DEFAULT: &#39;hsl(var(--popover))&#39;,<br>          foreground: &#39;hsl(var(--popover-foreground))&#39;,<br>        },<br>        card: {<br>          DEFAULT: &#39;hsl(var(--card))&#39;,<br>          foreground: &#39;hsl(var(--card-foreground))&#39;,<br>        },<br>      },<br>      borderRadius: {<br>        lg: `var(--radius)`,<br>        md: `calc(var(--radius) - 2px)`,<br>        sm: &#39;calc(var(--radius) - 4px)&#39;,<br>      },<br>      keyframes: {<br>        &#39;accordion-down&#39;: {<br>          from: { height: 0 },<br>          to: { height: &#39;var(--radix-accordion-content-height)&#39; },<br>        },<br>        &#39;accordion-up&#39;: {<br>          from: { height: &#39;var(--radix-accordion-content-height)&#39; },<br>          to: { height: 0 },<br>        },<br>      },<br>      animation: {<br>        &#39;accordion-down&#39;: &#39;accordion-down 0.2s ease-out&#39;,<br>        &#39;accordion-up&#39;: &#39;accordion-up 0.2s ease-out&#39;,<br>      },<br>    },<br>  },<br>  plugins: [TailwindAnimate],<br>  darkMode: [&#39;class&#39;],<br>};</pre><p><strong>Use shared tailwind.config.js in web-app application</strong></p><ul><li>Import shared tailwind config in web-app (apps/web-app/tailwind.config.js)</li></ul><pre>// app/web-app/tailwind.config.js<br><br>const TailwindConfig = require(&#39;../../libs/ui-kit/util/src/tailwind/tailwind.config&#39;);<br><br>module.exports = {<br>  ...TailwindConfig,<br>};</pre><h4>Step 7: Add “shared” global.css styles</h4><p>As we set up a repository to accommodate multiple applications, our aim is to share the global.css file. This file serves as a centralized location for defining our Tailwind imports and CSS variables. By consolidating these resources in one place, they become accessible to all applications and are particularly useful when generating Shadcn UI components.</p><p><strong>Add shared global.css file and consume it from web-app</strong></p><ul><li>Add styles folder in libs/ui-kit/util/src</li><li>Add file global.css in libs/ui-kit/util/src/styles</li></ul><pre>/* libs/ui-kit/util/src/styles/global.css */<br><br>@tailwind base;<br>@tailwind components;<br>@tailwind utilities;<br><br>@layer base {<br>  :root {<br>    --background: 0 0% 100%;<br>    --foreground: 240 10% 3.9%;<br>    --card: 0 0% 100%;<br>    --card-foreground: 240 10% 3.9%;<br>    --popover: 0 0% 100%;<br>    --popover-foreground: 240 10% 3.9%;<br>    --primary: 240 5.9% 10%;<br>    --primary-foreground: 0 0% 98%;<br>    --secondary: 240 4.8% 95.9%;<br>    --secondary-foreground: 240 5.9% 10%;<br>    --muted: 240 4.8% 95.9%;<br>    --muted-foreground: 240 3.8% 46.1%;<br>    --accent: 240 4.8% 95.9%;<br>    --accent-foreground: 240 5.9% 10%;<br>    --destructive: 0 84.2% 60.2%;<br>    --destructive-foreground: 0 0% 98%;<br>    --border: 240 5.9% 90%;<br>    --input: 240 5.9% 90%;<br>    --ring: 240 5.9% 10%;<br>    --radius: 0.5rem;<br>  }<br><br>  .dark {<br>    --background: 240 10% 3.9%;<br>    --foreground: 0 0% 98%;<br>    --card: 240 10% 3.9%;<br>    --card-foreground: 0 0% 98%;<br>    --popover: 240 10% 3.9%;<br>    --popover-foreground: 0 0% 98%;<br>    --primary: 0 0% 98%;<br>    --primary-foreground: 240 5.9% 10%;<br>    --secondary: 240 3.7% 15.9%;<br>    --secondary-foreground: 0 0% 98%;<br>    --muted: 240 3.7% 15.9%;<br>    --muted-foreground: 240 5% 64.9%;<br>    --accent: 240 3.7% 15.9%;<br>    --accent-foreground: 0 0% 98%;<br>    --destructive: 0 62.8% 30.6%;<br>    --destructive-foreground: 0 0% 98%;<br>    --border: 240 3.7% 15.9%;<br>    --input: 240 3.7% 15.9%;<br>    --ring: 240 4.9% 83.9%;<br>  }<br>}<br><br>@layer base {<br>  * {<br>    @apply border-border;<br>  }<br>  body {<br>    @apply bg-background text-foreground;<br>    font-feature-settings: &quot;rlig&quot; 1, &quot;calt&quot; 1;<br>  }<br>}</pre><ul><li>Import shared global.css in apps/web-app/src/app/global.css</li></ul><pre>/* apps/web-app/src/app/global.css */<br><br>@import &#39;../../../libs/ui-kit/util/src/styles/global.css&#39;;</pre><blockquote>The mentioned CSS variables are based on the default shadcn/ui theme. Using the shadcn/ui theme editor, you can effortlessly apply a different theme.<br>Explore available themes here: <a href="https://ui.shadcn.com/themes">https://ui.shadcn.com/themes</a></blockquote><h4>Step 8: Add util functionalities</h4><p>I use a cn(classname) helper to streamline the conditional addition of Tailwind CSS classes. Here’s how it’s implemented in libs/ui-kit/util/src/lib/cn.ts:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f135f93e3f5c751b21b3637751c39991/href">https://medium.com/media/f135f93e3f5c751b21b3637751c39991/href</a></iframe><p><strong>Note:</strong> Ensure the cn function is exported by index.ts in libs/ui-kit/util/src/</p><h4>Step 9: Add shadcn/ui components.json file</h4><p>The components.json file serves as a repository of configuration settings for your project within the shadcn/ui framework.</p><p>shadcn/ui leverages this file to comprehend the structural arrangement of your project and determine the specifications for generating customized components tailored to your project’s requirements.</p><p>Should you opt for the copy and paste methodology, the inclusion of this file becomes unnecessary.</p><p>Add components.json on root directory:</p><pre>{<br>  &quot;$schema&quot;: &quot;https://ui.shadcn.com/schema.json&quot;,<br>  &quot;style&quot;: &quot;new-york&quot;,<br>  &quot;rsc&quot;: false,<br>  &quot;tailwind&quot;: {<br>    &quot;config&quot;: &quot;libs/ui-kit/util/src/tailwind/tailwind.config.js&quot;,<br>    &quot;css&quot;: &quot;libs/ui-kit/util/src/styles/global.css&quot;,<br>    &quot;baseColor&quot;: &quot;stone&quot;,<br>    &quot;cssVariables&quot;: true<br>  },<br>  &quot;aliases&quot;: {<br>    &quot;components&quot;: &quot;@nx-next-shadcn-ui-starter/ui-kit/ui/lib&quot;,<br>    &quot;utils&quot;: &quot;@nx-next-shadcn-ui-starter/ui-kit/util&quot;<br>  }<br>}</pre><p>For now, the most important configuration options are:</p><ul><li>tailwind.config → path to tailwind config, used for component generation via shadcn/ui cli.</li><li>tailwind.css → path to global.css styles, used for component generation via shadcn/ui cli.</li><li>aliases.components → location to place components generated via shadcn/ui cli</li><li>aliases.utils → import path for util functions for components generated via shadcn/ui cli</li></ul><p><strong>Note: </strong>tsconfig adjustments in next step are crucial for applying this configuration.</p><p>For more details regarding the configuration I refer to the <a href="https://ui.shadcn.com/docs/components-json">official documentation</a>.</p><h4>Step 10: Extend tsconfig.base.json and add tsconfig.json</h4><p>To be able to work with the previously added components.json and the shadcn/ui cli, we need to provide direct import paths to our ui-kit/* libraries.</p><pre>{<br>  &quot;compilerOptions&quot;: {<br>    // ...<br>    &quot;paths&quot;: {<br>      &quot;@nx-next-shadcn-ui-starter/ui-kit/ui&quot;: [&quot;libs/ui-kit/ui/src/index.ts&quot;],<br>      &quot;@nx-next-shadcn-ui-starter/ui-kit/ui/*&quot;: [&quot;libs/ui-kit/ui/src/*&quot;],<br>      &quot;@nx-next-shadcn-ui-starter/ui-kit/util&quot;: [<br>        &quot;libs/ui-kit/util/src/index.ts&quot;<br>      ],<br>      &quot;@nx-next-shadcn-ui-starter/ui-kit/util/*&quot;: [&quot;libs/ui-kit/util/src/*&quot;]<br>    }<br>  }<br>}</pre><p>In addition, we must provide a tsconfig.json file (on root level), as this is mandatory to work with the shadcn/ui cli.</p><pre>{<br>  &quot;_COMMENT&quot;: &quot;only used by shadcn/ui cli to generate shadcn/ui components&quot;,<br>  &quot;extends&quot;: &quot;./tsconfig.base.json&quot;<br>}</pre><blockquote>👏 Congratulations, you are done with the setup process</blockquote><h4>Step 11: Generate shadcn/ui shared component</h4><p>We’re in the final stretch! Now, let’s dive into the exciting phase.</p><p>Our setup empowers us to effortlessly generate components based on shadnc/ui. The configuration we added earlier in components.json will be honored, and essential third-party components (such as radix-ui headless components) will be seamlessly integrated.</p><p>To generate the button component, simply execute the following command:</p><pre>npx shadcn-ui@latest add button</pre><p>This command will produce a newly generated component located at libs/ui-kit/ui/src/lib/ui/button.tsx.</p><p>However, with our current setup, there are a few considerations to keep in mind:</p><ol><li>A button component is typically intended for client-side rendering. To achieve this, include use client; at the beginning of button.tsx.</li><li>Ensure that the newly generated component is manually exported from the library. Add the following line to index.ts</li></ol><pre>export * from &#39;./lib/ui/button&#39;;</pre><p>With these steps, you’re all set to enjoy the benefits of the newly generated button component and you can use it within your web application.</p><p>To try out the new button component, add it in your page.tsx file of web-app project:</p><pre>import { Button } from &#39;@nx-next-shadcn-ui-starter/ui-kit/ui&#39;;<br><br>export default async function Index() {<br>  return (<br>    &lt;div className=&quot;hidden h-full flex-1 flex-col space-y-8 p-8 md:flex&quot;&gt;<br>      &lt;div className=&quot;flex items-center justify-between space-y-2&quot;&gt;<br>        &lt;div&gt;<br>          &lt;h2 className=&quot;text-2xl font-bold tracking-tight&quot;&gt;<br>            Welcome to web-app!<br>          &lt;/h2&gt;<br>          &lt;p className=&quot;text-muted-foreground&quot;&gt;<br>            A project to show how to integrate shadcn/ui with Next.js and Nx<br>          &lt;/p&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>      &lt;div&gt;<br>        &lt;Button&gt;Click me!&lt;/Button&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>When you visit now <a href="http://localhost:4200/">http://localhost:4200</a> you should see this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mhMeClz5UudepqSMByedkQ.png" /></figure><p>Happy coding! ✨</p><h3>Final words</h3><p>I hope this guide assists you in incorporating the shadcn/ui library into your Nx Monorepo alongside Next.js applications. Please feel free to provide any feedback or suggestions for improvement in the comment section below.</p><h3>References</h3><ul><li><a href="https://github.com/patrickvaler/nx-next-shadcn-ui-starter">GitHub Repository</a></li><li><a href="https://ui.shadcn.com/docs">Shadcn UI Documentation</a></li><li><a href="https://tailwindcss.com/docs/installation">Tailwindcss Documentation</a></li><li><a href="https://nx.dev/getting-started/intro">Nx Documentation</a></li><li><a href="https://github.com/shadcn-ui/ui/issues/778">https://github.com/shadcn-ui/ui/issues/778</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57908f48b4ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>