Skip to content

Installation

Start a new application on the Silkware Design System, from an empty folder to a build that passes.

This page takes you from an empty folder to a Next.js application that uses the Silkware theme and components. It uses the shadcn CLI on the React Aria base and installs everything from the Silkware registry. The code is copied into your project, so you own it from the first command.

Prerequisites

  • Node.js 20 or later and pnpm. The commands below use pnpm dlx; replace it with npx or bunx if you use another package manager.
  • The registry is reachable. This documentation site serves it at /r/{name}.json. Locally that is http://localhost:3000/r/{name}.json; in production it is the site URL you host it at. The examples below use the local address.

Install

  1. Create the project

    Run init with the Next.js template and the React Aria base. The vega preset gives you the aria-vega style that Silkware components are written for.

    pnpm dlx shadcn@latest init --template next --base aria --preset vega --name my-appcd my-app
  2. Add the registry

    Register the @silkware namespace in components.json.

    pnpm dlx shadcn@latest registry add "@silkware=http://localhost:3000/r/{name}.json"

    The command adds one line to components.json:

    {  "registries": {    "@silkware": "http://localhost:3000/r/{name}.json"  }}
  3. Install the theme

    The theme item is the whole app/globals.css of Silkware: colours for light and dark, the type scale, radius, shadows, motion, base rules and the font faces. It replaces the file that init wrote, so it needs --overwrite.

    pnpm dlx shadcn@latest add @silkware/theme --overwrite

    The theme also installs Typeset: app/typeset.css, imported by globals.css right after Tailwind. Its presets are in globals.css. Rendered text, such as Markdown from an agent or an article, is styled by wrapping it in a typeset container with a preset, for example typeset typeset-docs.

  4. Copy the fonts

    globals.css loads Mona Sans and Noto Sans SC from /fonts/. Font files are binary and a registry item can only carry text, so you copy them once into public/fonts. They are then served by your own application, with no request to another host at run time.

    mkdir -p public/fontscurl -o public/fonts/mona-sans.woff2 http://localhost:3000/fonts/mona-sans.woff2curl -o public/fonts/noto-sans-sc.woff http://localhost:3000/fonts/noto-sans-sc.woff

    init also loads Inter and Geist Mono through next/font in app/layout.tsx. The theme sets its own font tokens, so you can remove those imports and their class names from the layout.

  5. Add components

    Name the items you need. Dependencies, hooks and helpers come with them.

    pnpm dlx shadcn@latest add @silkware/button @silkware/field @silkware/dialog @silkware/sidebar @silkware/menubar @silkware/code-block --overwrite

    --overwrite replaces the button.tsx that init created with the Silkware one. Add AI patterns the same way:

    pnpm dlx shadcn@latest add @silkware/ai-chat @silkware/ai-tool
  6. Verify

    Import a component, then check the types and the build.

    import { Button } from "@/components/ui/button"
    export default function Page() {  return <Button>Approve order</Button>}
    pnpm typecheckpnpm build

    Open the page. Text should be set in Mona Sans on a white ground, with an ink button.

What changed in your project

PathWritten by
components.jsonThe registry add command: the @silkware namespace.
app/globals.css@silkware/theme.
app/typeset.css@silkware/typeset, installed with the theme.
public/fonts/The two curl commands.
components/ui/Each component you add.
components/ai-elements/Each AI pattern you add.
hooks/, lib/Hooks and helpers that components need, such as use-mobile and highlighter.
package.jsonThe npm packages that the items import.

Next steps

  • Change the brand in app/globals.css: see Theming.
  • Update or customise what you installed: see Registry.
  • Let your coding agent install components for you: see MCP.