Skip to content

Quick Start

Start by running:

Terminal window
npx shadcn@latest init

This sets up the expected project structure and creates components.json, which the registry install flow relies on.

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.

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.

Start with a component so you can validate your setup quickly.

Terminal window
npx shadcn@latest add @rokkit200-ui/button

This pulls the component into your app with the target paths defined by the registry item.

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.

Now install a block that composes multiple components and shared internals.

Terminal window
npx shadcn@latest add @rokkit200-ui/faq-one

Then 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.

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.

Installed registry items are your code. Treat them as a starting point and adapt them to your project.

Recommended approach:

  1. Start with className-based styling overrides and token changes first.
  2. Keep the public prop contract stable while adjusting internal markup or styles.
  3. For CMS-driven blocks, customise in layers: mapper -> props -> render.
  4. 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)