Introduction

Beautifully designed React components with satisfying microinteractions.

Riff is the set of components I built for this site, packaged so you can use them too: the table of contents, diagrams, the dock, search, the video player and the small interactive pieces in between. Each is one React 19 file and one native CSS file that you copy into your project and own. The few that need an accessible primitive build on UI SDK.

Every component is documented in plain TypeScript and CSS, so you and your coding agents can read, compose and restyle it.

Quickstart

Use these steps in a React 19 project with an existing components.json. For a new app, start with Installation.

  1. Register the namespace

    Add the @riff registry to components.json. The CLI replaces {name} with the component name.

    {
      "registries": {
        "@riff": "https://sarthakmishra.com/riff-ui/r/{name}.json"
      }
    }
  2. Add a component

    pnpm dlx shadcn@latest add @riff/file-tree

    The CLI writes file-tree.tsx and file-tree.css to your UI directory and saves the MIT license at licenses/riff-ui.txt. Components that need UI SDK or another package install it too.

  3. Render it

    import { File, FileTree, Folder } from '@/components/ui/file-tree';
    
    export function Files() {
      return (
        <FileTree label="Files">
          <Folder name="src">
            <File name="main.tsx" />
          </Folder>
        </FileTree>
      );
    }

Install without a namespace

Pass a GitHub path to shadcn add when you want one component without editing components.json:

pnpm dlx shadcn@latest add SarthakMishra/riff-ui/steps

The registry index at /riff-ui/r/registry.json lists every available component.