A full-stack developer creates a custom Shadcn UI component registry. The registry allows him to easily reuse and share his own UI components across projects. The project uses a specific folder structure for registry items. It is deployed on Vercel, to host the registry at a public URL.A full-stack developer creates a custom Shadcn UI component registry. The registry allows him to easily reuse and share his own UI components across projects. The project uses a specific folder structure for registry items. It is deployed on Vercel, to host the registry at a public URL.

Design Once, Reuse Everywhere — How I Built a Custom Shadcn UI Registry with Next.js and Vercel

2025/10/15 04:03

Table of Contents

  1. Motivation and planning
  2. Setting up the Next.js project
  3. Organising components in the registry
  4. Defining the registry index (registry.json)
  5. Building the registry and generating JSON files
  6. Deploying to Vercel
  7. Conclusion
  8. Resources/Links

1. Motivation and planning

I decided to create a custom Shadcn UI component registry to easily reuse and share my own UI components across projects. As a full-stack developer, I’m passionate about building beautiful, accessible, and performant web apps, and I often craft custom components that I want to use in multiple projects. The Shadcn UI framework provides a CLI for installing components from a remote registry, so running my own registry made perfect sense. It would allow me to distribute a collection of my favourite UI patterns and components (like complex form fields, interactive blocks, etc.) through a central repository.

Before coding, I read through the Shadcn UI documentation on custom registries to understand the requirements. Essentially, a registry is just a web app (in my case, a Next.js app) that serves JSON definitions of components. The only hard requirement is that it must provide a registry.json file at its root URL (the index of all components), and individual JSON files for each component, conforming to Shadcn’s schema. With this in mind, I planned out the project structure and technology stack:

  • Next.js 13 with the App Router for the application framework.
  • Tailwind CSS v4 for styling, since the Shadcn template is configured for Tailwind 4.
  • shadcn/ui CLI and registry template as a starting point, to get the correct file structure and scripts for building the registry.
  • Deployment on Vercel, to host the registry at a public URL where the CLI (and other developers) can reach the JSON files.

2. Setting up the Next.js project

To kickstart development, I used the official Shadcn/UI registry template as my base . This template already had a Next.js project configured for a registry, which saved a lot of setup time. I initialised my project from the template and pushed the initial code to GitHub as elvinlari/shadcn-registry. The template project came with a default registry.json and some example components to demonstrate the structure (like a “hello-world” component). It also included the necessary Tailwind config, Next.js config, and a build script. Using this template ensured my registry would meet Shadcn’s schema and file layout from the start.

After cloning the template, I updated the project metadata. I changed the name and homepage fields in registry.json to reflect my project (giving my registry a unique name and linking to its website). I then removed the scaffolded templates in registry/new-york/blocks/ and registry/new-york/ui/and updated app/page.tsx with my own homepage content. I also verified that Tailwind CSS was set up correctly (the template was already using Tailwind v4, which I stuck with).

3. Organising components in the registry

With the scaffolding ready, I started adding my own components into the registry. The project uses a specific folder structure for registry items. All components live under the registry/ directory, grouped by a namespace (the template uses a default namespace called “new-york”). Under that, I organised components by category.

For example, I created a folder:

registry/ └── new-york/     └── blocks/         └── landing-page/             ├── landing-page.tsx             ├── components/             │   ├── announcement.tsx             │   ├── marquee.tsx             │   └── video-player.tsx             └── README.md 

Here, landing-page is a Block component; essentially a full page section composed of smaller parts. Inside its folder, I have a landing-page.tsx which assembles the block’s JSX, and a components folder containing dependency components. In this case, the dependency components include an announcement banner, a scrolling marquee text, and an embedded video player. I wrote each of those pieces as separate React components (announcement.tsxmarquee.tsxvideo-player.tsx) to keep things modular.

Organising components this way (each in its own folder with a clear structure) made it easy to manage and document them. I also added a README.md inside the landing-page folder, describing what the block and components do and how to use them. This README content is displayed on the registry site as documentation for that component.

To illustrate, here’s a simplified version of the marquee component that I included in the landing page block:

// registry/new-york/blocks/landing-page/components/marquee.tsx  "use client"    import React from "react"  export function Marquee({ text }: { text: string }) {   return (     <div className="overflow-hidden whitespace-nowrap bg-muted px-4 py-2">       <span className="animate-marquee text-sm font-medium">         {text}       </span>     </div>   ); } 

\ This Marquee component simply takes text and scrolls it (assuming a Tailwind CSS animation class animate-marquee is defined). I created similar React components for Announcement (perhaps a top banner with a message) and VideoPlayer (using an HTML5 video or iframe).

Then, in landing-page.tsx of the landing page block, I put these pieces together:

// registry/new-york/blocks/landing-page/landing-page.tsx  import { Announcement } from "@/components/announcement" import { Marquee } from "@/components/marquee" import { VideoPlayer } from "@/components/video-player"  export default function LandingPage() {   return (     <section className="landing-page">       <Announcement message="Welcome to my custom registry!" />       <Marquee text="Building with Shadcn UI is fun" />       <VideoPlayer src="/demo.mp4" />     </section>   ); } 

Notes:

  1. The above code is a representative example for illustration. In my actual code, the content and props were tailored to my needs.
  2. Use path aliases, not relative paths. In your registry source and item files, import from @/components/... instead of ./components/... so the generated code resolves correctly when a consumer installs it into a different folder structure. Relative imports are tied to your registry’s local file layout; once the files are copied into another project, those ./ paths can break because the install location (e.g., app/components/, or a different nesting) won’t match your repo. The @ alias is project-rooted and is what most Next.js/shadcn setups expect, so it remains stable across projects.

Bad (relative, may break after install):

import { Button } from "./components/ui/button" import { Announcement } from "./components/announcement" 

Good (alias, portable):

import { Button } from "@/components/ui/button" import { Announcement } from "@/components/announcement" 

4. Defining the registry index (registry.json)

The heart of the registry is the registry.json file in the project root. This file serves as an index of all components/blocks available. Each entry in registry.json lists a component’s name, type, title, and the files that make it up, among other metadata.

After adding my components, I edited registry.json to register them. For example, I added an entry for the Landing Page block like this:

{   "$schema": "https://ui.shadcn.com/schema/registry.json",   "name": "Lynqsides Shadcn Registry",     "homepage": "https://shadcn-elvinlari-registry.vercel.app",   "items": [     {       "name": "landing-page",       "type": "registry:block",       "title": "Landing Page",       "description": "A full landing page section with announcement banner, marquee, and video player.",       "dependencies": ["@icons-pack/react-simple-icons", "@number-flow/react", "media-chrome", "react-fast-marquee"],       "registryDependencies": ["button", "card", "badge", "tabs"],       "files": [         {           "path": "registry/new-york/blocks/landing-page/landing-page.tsx",           "type": "registry:block"         },         {           "path": "registry/new-york/blocks/landing-page/components/announcement.tsx",           "type": "registry:ui"         },         {           "path": "registry/new-york/blocks/landing-page/components/marquee.tsx",           "type": "registry:ui"         },         {           "path": "registry/new-york/blocks/landing-page/components/video-player.tsx",           "type": "registry:ui"         }       ],       "cssVars": {         "theme": {           "font-heading": "Poppins, sans-serif"         },         "light": {           "brand": "20 14.3% 4.1%",           "radius": "0.5rem"         },         "dark": {           "brand": "20 14.3% 4.1%"         }       },       "css": {         "@layer base": {           "html": {             "scroll-behavior": "smooth"           }         }       }     },     // ... other items ...   ] } 

I set "type": "registry:block" because the landing-page is a composite, full-page section rather than a single UI primitive. Under dependencies, I list external npm packages the consumer must get (@icons-pack/react-simple-icons@number-flow/reactmedia-chromereact-fast-marquee). Under registryDependencies, I declare other shadcn items this block relies on (buttoncardbadgetabs); the CLI will fetch those from the upstream registry, so the block works out of the box. The files array is the install payload: one entry for the orchestrating block file (registry:block) and entries for each supporting piece in components/ (registry:ui). This tells the CLI exactly which files to copy into the target app and their default installation location.

You can also ship design tokens via cssVars: a global theme token for the heading font (Poppins, sans-serif), plus light/dark palette values like brand (HSL triplet) and a radius for rounding. These integrate with shadcn/Tailwind’s variable-driven colours (e.g., bg-backgroundtext-foregroundring, etc.). Finally, I appended a global style through css by contributing to @layer baseto enable smooth scrolling on html. Together, this entry ensures the block, its subcomponents, its npm deps, its shadcn deps, and its theme/base CSS all install and “just work” when someone runs shadcn add against my registry.

5. Building the registry and generating JSON files

Once the code for components and the registry.json index were in place, I used the Shadcn CLI to build the registry. The command:

pnpm registry:build 

scans the registry.json and the referenced component files, and produces the distributable JSON files for each item. After running this, my Next.js app’s public directory was populated with a JSON file per component (as well as an overall registry.json for the index) that will be served to users. For example, public/r/landing-page.json was generated, containing the combined content and metadata of the Landing Page component. The CLI automates this conversion from my source files to the JSON schema that other projects can consume. Having these as static files means the registry doesn’t need a live database. Any request to https://shadcn-elvinlari-registry.vercel.app/r/landing-page.json will just return the JSON describing the component (Next.js serves it like a static asset). This static approach makes hosting easy and caching efficient.

:::info Note: The template provided a dynamic Next.js route handler for registry items, but since we output static files, the dynamic route simply proxies those or handles any special cases. In practice, I found the static files sufficient for all my components.

:::

6. Deploying to Vercel

With everything tested locally, I was ready to deploy. I pushed the final code to the GitHub repo and connected it to Vercel for continuous deployment. The deployment process on Vercel was straightforward: I set up a new project, pointed it to my GitHub repository, and Vercel handled installing dependencies and building the Next.js app. Since this is a Next.js App Router project, Vercel recognized it and optimized the build for me.

I ended up doing a few quick-fix commits to adjust the domain value once the app was live (making sure there were no leftover references to a localhost or template example domain). Those “fix: edit domain” commits in my history were exactly for this.

After a successful deployment, I visited my registry’s URL and saw the documentation site up and running. The homepage of my registry site includes a list of components available and an introduction (I added a personal About the Author section with my social links, to give it a nice personal touch). Each component has its own page showing how to use it and a preview of the component in action. For example, the Landing Page block’s page displays the announcement banner, marquee, and video player demo, as well as the code snippets.

Finally, I tested the integration end-to-end. I went to a separate test Next.js project and tried installing a component from my registry using the Shadcn CLI. I ran the following command:

pnpm dlx shadcn@latest add https://shadcn-elvinlari-registry.vercel.app/r/landing-page.json 

This command pulls landing-page.json from my public registry, copies all referenced files into the project (mirroring my registry’s folder structure), and installs both the npm dependencies and shadcn registryDependencies the block needs. It also applies any cssVars and merges the item’s css into the project’s global styles (or writes the shipped CSS file if I included one). Result: my custom components were ready to use immediately, with code and styles fully wired up.

Conclusion

In summary, I built my own Shadcn UI registry by leveraging Next.js and the Shadcn registry template. I authored custom components, defined them in a registry.json index, and used the Shadcn CLI’s build process to generate JSON specs for each component . The project doubles as a documentation site where I (and others) can browse and preview components, and it serves as a distribution mechanism so that any React project can install these components via one CLI command. Deploying on Vercel made it easy to share my registry with the world — it’s fast and globally accessible.

This was a really fun project because it combined my love for building reusable components with the excitement of creating a platform others can use. I now have a personal UI library, “Lynq Components”, that is just a pnpm dlx shadcn add away for any of my future projects. Feel free to check out the registry (https://shadcn-elvinlari-registry.vercel.app) and reach out if you have any questions or suggestions. Happy coding!

I hope this has been a helpful guide. Thank you for reading!

https://ui.shadcn.com/docs— Shadcn/UI Documentation \n https://github.com/shadcn-ui/registry-template.git—Shadcn/UI Registry Template \n https://github.com/elvinlari/shadcn-registry.git—My Custom Registry Code \n https://shadcn-elvinlari-registry.vercel.app —My Deployed Shadcn Registry

\n

Disclaimer: The articles reposted on this site are sourced from public platforms and are provided for informational purposes only. They do not necessarily reflect the views of MEXC. All rights remain with the original authors. If you believe any content infringes on third-party rights, please contact [email protected] for removal. MEXC makes no guarantees regarding the accuracy, completeness, or timeliness of the content and is not responsible for any actions taken based on the information provided. The content does not constitute financial, legal, or other professional advice, nor should it be considered a recommendation or endorsement by MEXC.

You May Also Like

Ripple Buyers Step In at $2.00 Floor on BTC’s Hover Above $91K

Ripple Buyers Step In at $2.00 Floor on BTC’s Hover Above $91K

The post Ripple Buyers Step In at $2.00 Floor on BTC’s Hover Above $91K appeared on BitcoinEthereumNews.com. Token breaks above key support while volume surges 251% during psychological level defense at $2.00. News Background U.S. spot XRP ETFs continue pulling in uninterrupted inflows, with cumulative demand now exceeding $1 billion since launch — the fastest early adoption pace for any altcoin ETF. Institutional participation remains strong even as retail sentiment remains muted, contributing to market conditions where large players accumulate during weakness while short-term traders hesitate to re-enter. XRP’s macro environment remains dominated by capital rotation into regulated products, with ETF demand offsetting declining open interest in derivatives markets. Technical Analysis The defining moment of the session came during the $2.03 → $2.00 flush when volume spiked to 129.7M — 251% above the 24-hour average. This confirmed heavy selling pressure but, more importantly, marked the exact moment where institutional buyers absorbed liquidity at the psychological floor. The V-shaped rebound from $2.00 back into the $2.07–$2.08 range validates active demand at this level. XRP continues to form a series of higher lows on intraday charts, signaling early trend reacceleration. However, failure to break through the $2.08–$2.11 resistance cluster shows lingering supply overhead as the market awaits a decisive catalyst. Momentum indicators show bullish divergence forming, but volume needs to expand during upside moves rather than only during downside flushes to confirm a sustainable breakout. Price Action Summary XRP traded between $2.00 and $2.08 across the 24-hour window, with a sharp selloff testing the psychological floor before immediate absorption. Three intraday advances toward $2.08 failed to clear resistance, keeping price capped despite improving structure. Consolidation near $2.06–$2.08 into the session close signals stabilization above support, though broader range compression persists. What Traders Should Know The $2.00 level remains the most important line in the sand — both technically and psychologically. Institutional accumulation beneath this threshold hints at larger players…
Share
BitcoinEthereumNews2025/12/08 13:22
SPX6900 Hits the Brakes, While MOBU Hits the Afterburners with its Next 100x Crypto presale, and TRUMP Dips

SPX6900 Hits the Brakes, While MOBU Hits the Afterburners with its Next 100x Crypto presale, and TRUMP Dips

Ever wondered which meme coins could offer the next big breakout in 2025? With altcoins like SPX6900 and Official Trump trending in community chatter, the market is buzzing with potential, yet only a few offer genuine early-stage investment opportunities. Investors who missed previous moonshots are looking for projects that combine novelty, strong community, and robust presale mechanics. Among these, MOBU crypto has emerged as a strong contender for the next 100x crypto presale, thanks to its structured presale mechanics, active community engagement, and impressive early-stage ROI. MOBU Crypto: Next 100x Crypto Presale in Motion MOBU crypto stands out as the next 100x crypto presale with its meticulously structured presale offering and unique investment potential. Stage 6 is live at $0.00008388, boasting over 2,100 token holders and a presale tally surpassing $650K. Joining the presale is simple: connect the official website, choose your currency, and lock in before prices rise again. SPX6900 Hits the Brakes, While MOBU Hits the Afterburners with its Next 100x Crypto presale, and TRUMP Dips 10 Moreover, the 95% APY Staking program gives holders consistent passive returns while maintaining flexibility. Tokens can be staked anytime through the dashboard, with rewards calculated daily and only a two-month lock-in on earnings. With $14.6 billion $MOBU allocated, this system rewards loyalty, encourages long-term participation, and strengthens liquidity, ensuring that all holders, small or large, share in the project’s growth and success. MOBU Crypto Precision Entry: Presale Power Boost The $MOBU presale is designed to maximize early investor rewards through first-come, first-served access. Investors can capitalize on scenarios such as a $200 purchase turning into $14,687.65 or a $300 investment that could reach $22,031.47. The presale mechanics encourage active participation while fostering community growth. SPX6900 (SPX) Shows Strong Weekly Momentum as Investor Interest Rises SPX6900 (SPX) recorded a notable upswing over the past week, reflecting renewed investor interest and increased participation across the meme coin sector. The asset’s recent upward movement showcases improving market sentiment and highlights the growing attention SPX6900 continues to attract within the crypto community. Market performance for SPX6900 also shows substantial activity, with its market capitalization and 24-hour trading volume remaining robust. The project’s fully diluted valuation similarly reflects strong potential should all tokens enter circulation, signaling steady confidence from traders and long-term holders. Official Trump (TRUMP) Faces Weekly Pullback as Market Correction Unfolds Official Trump (Official Trump) experienced a noticeable decline in its weekly performance as market-wide corrections and short-term investor profit-taking contributed to downward pressure. Despite the pullback, the asset continues to remain active within trading circles, supported by consistent engagement from its community. The cryptocurrency maintains substantial market capitalization and daily trading volume, illustrating steady market participation even during corrective phases. Its fully diluted valuation also highlights the long-term potential of the project if all tokens were to circulate, demonstrating ongoing interest from speculators and long-term market observers. SPX6900 Hits the Brakes, While MOBU Hits the Afterburners with its Next 100x Crypto presale, and TRUMP Dips 11 Final Words SPX6900 and Official Trump continue to capture attention through meme-driven community engagement and trending collaborations. Their ongoing growth reflects broader market enthusiasm, yet they lack structured presale benefits like those offered by MOBU crypto. MOBU crypto, with Stage 6 live and over 2,100 token holders, provides a unique opportunity for investors seeking the next 100x crypto presale.  The presale provides first-come, first-served advantages, verified token allocations, and significant ROI potential, making it a must-watch project in the evolving meme coin landscape. SPX6900 Hits the Brakes, While MOBU Hits the Afterburners with its Next 100x Crypto presale, and TRUMP Dips 12 For More Information: Website: Visit the Official MOBU Website  Telegram: Join the MOBU Telegram Channel Twitter: Follow MOBU ON X (Formerly Twitter) Frequently Asked Questions About the Next 100x Crypto Presale What is the 1000x meme coin in 2025? MOBU crypto is considered a strong candidate for high ROI potential, aiming for significant growth in 2025. Which coin is best to invest for 2025? The MOBU crypto presale is currently the next 100x crypto presale, thanks to its early-stage investment benefits. What meme coin has 1000x? Early investors in MOBU crypto presale have the potential for exponential gains as the project progresses to listing. What is the projected ROI for early MOBU crypto investors? Early investors until Stage 6 have achieved a 235.52% ROI with further price surge expected. Are MOBU crypto presale tokens safe? Yes, MOBU crypto tokens are distributed transparently, with audited processes that ensure security. Glossary of Key Terms Meme Coin: A cryptocurrency inspired by internet memes and pop culture.  Presale: An early-stage token sale offering initial access to investors.  ROI: Return on Investment; profit earned from an investment.  Token Holder: An individual or entity owning tokens of a cryptocurrency.  Listing Price: The price at which a cryptocurrency becomes available on exchanges.  First Come, First Served: Allocation strategy prioritizing early participants.  NFT: Non-Fungible Token; a unique digital asset often associated with meme projects. Summary MOBU crypto, SPX6900, and Official Trump offer diverse opportunities in the meme coin space, but MOBU crypto presale Stage 6 presents unmatched early-stage investment potential. With over 2,100 token holders, presale tally exceeding $640K, and ROI already surpassing 235%, MOBU crypto emerges as the next 100x crypto presale. The presale’s first-come, first-served approach creates FOMO-driven urgency, while a transparent token distribution ensures trust and accessibility. Disclaimer This article is for informational purposes only and does not constitute financial advice. Investors should conduct their own research before participating in any cryptocurrency presale or investment. Read More: SPX6900 Hits the Brakes, While MOBU Hits the Afterburners with its Next 100x Crypto presale, and TRUMP Dips">SPX6900 Hits the Brakes, While MOBU Hits the Afterburners with its Next 100x Crypto presale, and TRUMP Dips
Share
Coinstats2025/12/08 11:45