Skip to main content

Installation

Most apps use the component registry: it copies component source into your repo, and needs no authentication and no npm package. Three other routes exist for particular cases:

  • a no-build bundle, for prototypes and static pages;
  • the tokens npm package, only if you write Tailwind utilities of your own;
  • prismds, for Python and Django apps. See Python & Django.

1. Components from the registry​

The component library is distributed source-first through a shadcn-style registry. You pull a component and its dependencies into your own repo and own the code.

Add the Prism registry to your components.json:

{
"$schema": "https://ui.shadcn.com/schema.json",
"registries": {
"@prism": "https://prism.artoftechconsulting.com/registry/{name}.json"
}
}

Then add components by name:

npx shadcn@latest add @prism/button
npx shadcn@latest add @prism/data-grid @prism/dialog @prism/empty-state

Each install also brings in what the component depends on:

  • @prism/prism-globals: every token, every theme and the base reset, as styles/prism-globals.css.
  • @prism/prism-components-css: every component's styles in one file, styles/prism-components.css. Adding a component later never needs a new import.
  • any sibling components it composes.

Browse available items at /registry/registry.json.

Add fonts, once​

Fonts are opt-in, so that re-pulling a component never overwrites your fonts file.

npx shadcn@latest add @prism/prism-fonts-selfhost # or @prism/prism-fonts (CDN)

The base theme uses Roboto Flex, Atkinson Hyperlegible Next and Atkinson Hyperlegible Mono. Industry uses Geist and Geist Mono. Enterprise uses IBM Plex. Skip this step and text falls back to system fonts without any warning.

Import the styles and set a theme​

shadcn copies files but cannot add imports to yours. Import three files once at the app root, in this order:

import './styles/prism-globals.css'; // tokens, themes, base
import './styles/prism-components.css'; // every component's styles
import './styles/prism-fonts.css'; // @font-face
<html data-theme="system">

data-theme takes light, dark or system; industry, industry-dark or industry-system; enterprise, enterprise-dark or enterprise-system. Each -system value follows the reader's operating system. See Theming & signatures.

Use a component​

import { Button } from '@/components/prism/Button';

<Button variant="accent" size="md">Save changes</Button>

Types come from the .d.ts beside each component. Style your own layout with the tokens (var(--surface-page), var(--gap-section)). Tailwind is not required.

Next.js (App Router)​

  • Route Prism links through next/link, once. Wrap the app in LinkProvider from a client providers file. Without it, Prism links are plain <a> elements and cause full page loads.

    // app/providers.jsx
    "use client";
    import Link from "next/link";
    import { LinkProvider } from "@/components/prism/LinkProvider";

    export function Providers({ children }) {
    return <LinkProvider component={Link}>{children}</LinkProvider>;
    }
  • "use client" is already there. Every component with state, effects or event handlers ships with the directive, so you can render it from a server component.

  • Forms submit natively. Give a field a name and its value goes with the form, including Select and NumberField.

2. No-build bundle (prototypes)​

Link the stylesheet and the compiled bundle, then read components off the global namespace.

<link rel="stylesheet" href="https://prism.artoftechconsulting.com/docs/runtime/styles.css" />
<script src="https://unpkg.com/react@18.3.1/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.development.js"></script>
<script src="https://prism.artoftechconsulting.com/docs/runtime/_ds_bundle.js"></script>
<script>
const { Button } = window.PrismDesignSystem_39d121;
// render with React as usual
</script>

This is what every live demo on this site does. Keep the absolute URLs: styles.css is an @import manifest whose relative imports resolve against its own origin, and the runtime lives under /docs/runtime/ (a root-relative /runtime/ returns 403 from the CDN). The demos serve their fonts from /docs/runtime/assets/fonts/.

3. Tokens in a Tailwind project (optional)​

Prism components never use Tailwind utilities. Install the tokens package only if you want Prism values in the utilities you write.

npm install @artoftechconsulting/prism-tokens
// tailwind.config.js (Tailwind v3)
module.exports = {
presets: [require('@artoftechconsulting/prism-tokens/dist/tailwind-v3-preset.cjs')],
};
/* Tailwind v4 */
@import "@artoftechconsulting/prism-tokens/dist/tailwind-v4.css";

Now bg-brand-500, text-accent, the spacing scale and the font roles resolve to Prism values.

Authenticate to GitHub Packages​

This package, and only this package, is private. It is published to GitHub Packages under the @artoftechconsulting scope.

  1. Create a token: GitHub → Settings → Developer settings → Personal access tokens (classic), with scope read:packages and access to the organisation.

  2. Add an .npmrc in your project root or home directory:

    @artoftechconsulting:registry=https://npm.pkg.github.com
    //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}
  3. Check you got the real package, not the reserved public placeholder:

    npm view @artoftechconsulting/prism-tokens version # a real 2.x, not 0.0.2
Keep the scope line — it's a security control

The @artoftechconsulting:registry=… line is required. It pins the whole @artoftechconsulting scope to GitHub Packages. Without it, npm can fall back to public npm for that name, which is the classic dependency-confusion attack: someone publishes a malicious package under the same name publicly and your install takes it. Ship this line in every project and every CI job that installs the package.