React

Rsbuild

Learn how to install and use Crispy in Rsbuild projects.

Install Dependencies

Install the necessary dependencies.

npm install @seed-design/react @seed-design/css

Importing base.css

index.tsx
import "@seed-design/css/base.css";

Creating seed-design.json

npx @seed-design/cli@latest init

Configure seed-design

◇  Do you use TypeScript?
│  Yes
│
◇  Do you use React Server Components?
│  No
│
◇  Enter the seed-design folder path. (The default is the project root.)
│  ./seed-design

Configuring tsconfig.json

Must be the same as the path of the seed-design.json path configured above.

tsconfig.json
{
  "compilerOptions": {
    // ... your options
    "paths": {
      "seed-design/*": [
        "./seed-design/*"
      ]
    }
  }
}

Modifying Rsbuild config

npm install -D @seed-design/rsbuild-plugin

seedDesignPlugin handles theming and automatic CSS file loading, etc.

rsbuild.config.ts
import { defineConfig } from "@rsbuild/core";
import { pluginReact } from "@rsbuild/plugin-react";
import { seedDesignPlugin } from "@seed-design/rsbuild-plugin"; 

export default defineConfig({
  plugins: [
    pluginReact(),
    seedDesignPlugin(), 
  ],
});

Plugin Options

Without options, color mode follows the user's system settings. To fix it to light or dark, specify colorMode.

OptionTypeDefaultDescription
colorMode"system" | "light-only" | "dark-only""system"Global color mode. system follows the user's OS setting
injectColorSchemeTagbooleantrueWhether to inject the color-scheme meta tag
fontScalingbooleanfalseOn iOS, whether to scale text according to the user's system text size setting
rsbuild.config.ts
seedDesignPlugin({
  colorMode: "light-only",
});

How color mode works is covered in Theming.

Try using a component?

npx @seed-design/cli@latest add ui:action-button

Getting Started with Stackflow

Learn how to set up the Crispy Stackflow plugin to use Crispy AppScreen.

Table of contents