---
title: "Installation"
url: "https://sarthakmishra.com/riff-ui/installation"
description: "Set up Riff in a new or existing React 19 project with the shadcn CLI and the @riff registry, or copy the .tsx and .css source files into your app."
image: "https://sarthakmishra.com/riff-og-image.webp"
---

[View HTML](https://sarthakmishra.com/riff-ui/installation) · [Site index](https://sarthakmishra.com/llms.txt)

# Installation

Set up Riff in a new or existing React 19 project.

Riff needs React 19 and a project the shadcn CLI can write into. The quickest route is to let the CLI scaffold the project for you, then add the components you want.

## Create the project

Pick your framework. Each command creates the app, configures the `@/*` import alias and writes `components.json`. Follow the prompts; any base library works, since Riff brings its own primitives.

### Next.js

```bash
pnpm dlx shadcn@latest init -t next -n my-app
```

### Vite

```bash
pnpm dlx shadcn@latest init -t vite -n my-app
```

### TanStack Start

```bash
pnpm dlx shadcn@latest init -t start -n my-app
```

For React Router or Astro, use `-t react-router` or `-t astro`. Adding to an existing app instead? Run `init` without `-t` in its root.

## Register the namespace

Add the `@riff` registry to the new `components.json`:

```json
{
  "registries": {
    "@riff": "https://sarthakmishra.com/riff-ui/r/{name}.json"
  }
}
```

## Add components

Install one or several at once. The CLI adds each component’s npm dependencies, such as UI SDK, the first time.

```bash
pnpm dlx shadcn@latest add @riff/table-of-contents @riff/steps
```

Then import them from your UI folder:

```tsx
import { TableOfContents } from '@/components/ui/table-of-contents';
import { Step, Steps } from '@/components/ui/steps';
```

Each component imports its own stylesheet, so there is nothing to add to your global CSS. To match your brand, map the [theme properties](https://sarthakmishra.com/riff-ui/theming) to your tokens.

## Without the CLI

You don’t need shadcn at all. Copy a component’s two files from the **Manual** section of its page, or from the [GitHub repository](https://github.com/SarthakMishra/riff-ui), into your project. Keep the `.css` file beside the `.tsx`, since the component imports it by relative path. If its Manual section lists a package to install, such as UI SDK, install that too.

## Structured data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebSite",
      "@id": "https://sarthakmishra.com/#website",
      "url": "https://sarthakmishra.com/",
      "name": "Sarthak Mishra",
      "publisher": {
        "@id": "https://sarthakmishra.com/#person"
      },
      "inLanguage": "en"
    },
    {
      "@type": "Person",
      "@id": "https://sarthakmishra.com/#person",
      "name": "Sarthak Mishra",
      "url": "https://sarthakmishra.com/about",
      "jobTitle": "Design Engineer",
      "image": "https://sarthakmishra.com/og-images/sarthak-mishra.webp",
      "sameAs": [
        "https://github.com/SarthakMishra",
        "https://www.linkedin.com/in/itssarthakmishra/",
        "https://x.com/MishraMishry"
      ]
    },
    {
      "@type": "WebPage",
      "@id": "https://sarthakmishra.com/riff-ui/installation#webpage",
      "url": "https://sarthakmishra.com/riff-ui/installation",
      "name": "Installation - Riff UI React Components",
      "description": "Set up Riff in a new or existing React 19 project with the shadcn CLI and the @riff registry, or copy the .tsx and .css source files into your app.",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://sarthakmishra.com/#website"
      },
      "about": {
        "@id": "https://sarthakmishra.com/#person"
      }
    }
  ]
}
```
