How a Zenius UI component
gets into your app

The registry hands out copies, not a package. Each app owns its copy, and nothing changes in an app until someone runs shadcn add again.

    
    

    No server to host, just files

    npm run build in zenius-ui writes one JSON file per component into public/r/. The CLI downloads that one file. Anything that serves files and checks a login can be the registry, and a private GitHub repo already does both.

    We tested this against a private Zenius repo through raw.githubusercontent.com:

    404No token. GitHub hides private repos from strangers.
    200With Authorization: Bearer <token>, the header our components.json already sends.

    What lives where

    zenius-ui repoEach app
    Source of truthYesIts own copy
    Needs the tokenPush accessOnly when running add
    CI and prod buildsNot involvedUse committed files
    Changes reach appsOn push to mainNever by themselves
    Pin a versionTag, e.g. v1.2.0Put the tag in the URL

    Updating is a reviewed copy, not an upgrade

    There is no shadcn update. You run add again. --diff shows your copy against the registry without changing anything. --overwrite takes the new version.

    The diff on the right is the real output from our Next demo after we changed the local button from h-12 to h-14. It shows the one line that drifted, then asks before writing.

    --overwrite wipes local edits. If an app needs a different look, wrap the component or pass className, and leave the installed file alone.

    Expect some formatting noise in diffs. Tryout uses double quotes and mobile uses single, so run the app's formatter after overwriting.

    npx shadcn@4.23.1 add @zenius/button-web --diff
     const sizes = {   md: "h-10 gap-2 px-4 text-[14px] leading-5",-  lg: "h-14 gap-2 px-6 text-[16px] leading-6",+  lg: "h-12 gap-2 px-6 text-[16px] leading-6", }
    overwrite src/components/ui/button.tsx? (y/n [n])
    − your app's copy · + registry version. The md line is shown for context.

    Same button in Next and Expo

    Both versions take the same props: variant (primary, purchase, secondary, outline, ghost), size (sm, md, lg), shape (pill, rounded), loading, disabled, leadingIcon and trailingIcon. Only the click prop differs: onClick on the web, onPress in Expo. These snippets come from our two demo apps.

    Next.js (Tailwind)

    Expo (react-native-paper)

    # 1. install: also pulls tokens-web
    npx shadcn@4.23.1 add @zenius/button-web
    # 1. install: also pulls tokens-native
    npx shadcn@4.23.1 add @zenius/button-native

    Creates src/components/ui/button.tsx and src/styles/znet-tokens.css. It needs cn() from @/lib/utils.

    Creates components/zenui/Button.tsx and theme/znet-tokens.ts. It reads light or dark mode from Paper's theme.

    /* 2. once, in src/app/globals.css */
    @import "../styles/znet-tokens.css";
    // 2. once, at the app root
    <PaperProvider theme={dark ? MD3DarkTheme : MD3LightTheme}>
      <App />
    </PaperProvider>
    // 3. use it: client component when it has handlers
    "use client";
    import { useState } from "react";
    import { Button } from "@/components/ui/button";
    
    export default function BuyBar() {
      const [busy, setBusy] = useState(false);
      return (
        <div className="flex gap-3">
          <Button variant="outline">Lihat detail</Button>
          <Button variant="purchase" size="lg" loading={busy}
            onClick={() => setBusy(true)}>
            Beli paket
          </Button>
        </div>
      );
    }
    // 3. use it
    import { useState } from 'react';
    import { View } from 'react-native';
    import { Button } from '@/components/zenui/Button';
    
    export function BuyBar() {
      const [busy, setBusy] = useState(false);
      return (
        <View style={{ flexDirection: 'row', gap: 12 }}>
          <Button variant="outline">Lihat detail</Button>
          <Button variant="purchase" size="lg" loading={busy}
            onPress={() => setBusy(true)}>
            Beli paket
          </Button>
        </View>
      );
    }

    For dark mode, put class="dark" on any parent and the tokens switch.

    Load the Plus Jakarta Sans fonts with useFonts before rendering, as the Expo demo does.

    One token per developer

    OptionRotationWhen someone leaves
    Personal fine-grained token
    zenius-ui only, Contents read, 90-day expiry
    Expiry does itRemove from GitHub, done
    gh auth token
    nothing stored on disk
    Handled by ghRemove from GitHub, done
    Shared team tokenManual, for everyoneRotate and redistribute

    The gh token can read every repo you can, but it is never written into the app. Either option is fine.

    Cheat sheet

    # .env.local in each app (not committed)
    ZENIUS_UI_URL=https://raw.githubusercontent.com/zenius-edu/zenius-ui/main/public
    ZENIUS_UI_TOKEN=github_pat_…
    # install or update
    npx shadcn@4.23.1 add @zenius/button-web
    npx shadcn@4.23.1 add @zenius/button-web --diff
    npx shadcn@4.23.1 add @zenius/button-web --overwrite
    # no token file at all
    ZENIUS_UI_TOKEN=$(gh auth token) npx shadcn@4.23.1 add @zenius/button-web