React

Webpack

Learn how to install and use Crispy in Webpack projects.

Install Dependencies

Install the necessary dependencies.

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

Importing base.css

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

Configuring Webpack config

webpack.config.ts
+import { SeedDesignPlugin } from '@seed-design/webpack-plugin';

export default defineConfig({
  plugins: [
+    new 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
webpack.config.ts
new SeedDesignPlugin({ colorMode: "light-only" });

How color mode works is covered in Theming.

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

Try using a component?

npx @seed-design/cli@latest add ui:action-button
tsconfig.json
{
  "compilerOptions": {
    // ... your options
    "paths": {
      "seed-design/*": [
        "./seed-design/*"
      ]
    }
  }
}

Getting Started with Stackflow

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

Table of contents