Quick Start
Initialize shadcn first
Section titled “Initialize shadcn first”Start by running:
npx shadcn@latest initThis sets up the expected project structure and creates components.json, which the registry install flow relies on.
Configure the registry endpoint
Section titled “Configure the registry endpoint”Add the following registries entry to your components.json file to point to the rokkit200-ui registry.
"registries": { "@rokkit200-ui": "https://ui.rokkit200.co/r/{name}.json"}This guide uses examples from this registry and shows the general pattern you can reuse for any item.
What you are installing
Section titled “What you are installing”This registry separates:
- Blocks (editor intent): content-focused sections such as FAQ, Hero, Gallery, and Testimonial
- Components (UI capability): reusable primitives such as Button, Link, Accordion, and Carousel
Use components when you need a reusable UI primitive. Use blocks when you need a complete CMS-friendly content section.
Add your first Component
Section titled “Add your first Component”Start with a component so you can validate your setup quickly.
Install a component
Section titled “Install a component”npx shadcn@latest add @rokkit200-ui/buttonThis pulls the component into your app with the target paths defined by the registry item.
See it working
Section titled “See it working”Import and render the installed component in a page or feature component:
import { Button } from "@/rokkit200-ui/components/button/button";
export default function Example() { return <Button variant="primary">Get Started</Button>;}If this renders correctly, your registry configuration and local aliases are working.
Add your first Block
Section titled “Add your first Block”Now install a block that composes multiple components and shared internals.
npx shadcn@latest add @rokkit200-ui/faq-oneThen use it in your app:
import { FaqOne } from "@/rokkit200-ui/blocks/faq/variants/faq-one/faq-one";
const faqData = { heading: "Frequently asked questions", mainBody: [], items: [ { id: "shipping", heading: "How long does shipping take?", mainBody: [], }, ],};
export default function ExampleFaq() { return <FaqOne {...faqData} />;}For CMS-driven usage, map your CMS response to block props before rendering. Keep mapping logic separate from UI so your component API remains stable.
File structure and dependencies matter
Section titled “File structure and dependencies matter”Registry items are designed to install into a predictable structure. In most projects, installed files appear under:
src/ rokkit200-ui/ blocks/ components/ lib/Why this matters:
- Import paths remain stable as you add more items
- Shared internals are resolved consistently
- Future updates are easier to reason about
Also pay attention to transitive dependencies declared by each registry item. Blocks often depend on shared internals and multiple components. Install via the registry name (for example, @rokkit200-ui/faq-one) so required dependencies are brought in with the expected paths.
Edit and customise safely
Section titled “Edit and customise safely”Installed registry items are your code. Treat them as a starting point and adapt them to your project.
Recommended approach:
- Start with className-based styling overrides and token changes first.
- Keep the public prop contract stable while adjusting internal markup or styles.
- For CMS-driven blocks, customise in layers: mapper -> props -> render.
- Avoid deleting shared utility imports unless you are sure no other installed items rely on them.
As your implementation evolves, preserve the core separation:
- Keep editor intent in block-level APIs (
heading,items,mainBody, etc.) - Keep UI capability details inside component internals (
selectionMode,deviceMode, layout mechanics)