# Vite URL: /react/getting-started/installation/vite Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/getting-started/installation/vite.mdx Learn how to install and use Crispy in Vite projects. ### Install Dependencies Install the necessary dependencies. - npm: npm install @seed-design/react @seed-design/css - pnpm: pnpm add @seed-design/react @seed-design/css - yarn: yarn add @seed-design/react @seed-design/css - bun: bun add @seed-design/react @seed-design/css ### Importing base.css ```ts title="index.tsx" import "@seed-design/css/base.css"; ``` ### Creating seed-design.json ### Running the init command ```sh npx @seed-design/cli@latest init ``` ### Configure seed-design ```sh ◇ 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 ``` Create the following file in your project root. ```json title="seed-design.json" { "rsc": false, "tsx": true, "path": "./seed-design" } ``` ### Configuring tsconfig.json Must be the same as the path of the [seed-design.json path](/react/getting-started/cli/configuration#path) configured above. ```json title="tsconfig.app.json" { "compilerOptions": { // ... your options "paths": { // [!code highlight] "seed-design/*": [ // [!code highlight] "./seed-design/*" ] } } } ``` ### Modifying Vite config - npm: npm install -D @seed-design/vite-plugin - pnpm: pnpm add -D @seed-design/vite-plugin - yarn: yarn add --dev @seed-design/vite-plugin - bun: bun add --dev @seed-design/vite-plugin `seedDesignPlugin` handles theming and automatic CSS file loading, etc. ```ts title="vite.config.ts" import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; import { seedDesignPlugin } from "@seed-design/vite-plugin"; // [!code highlight] export default defineConfig({ plugins: [ react(), seedDesignPlugin(), // [!code highlight] ], resolve: { tsconfigPaths: true, // [!code highlight] }, }); ``` - npm: npm install -D @seed-design/vite-plugin vite-tsconfig-paths - pnpm: pnpm add -D @seed-design/vite-plugin vite-tsconfig-paths - yarn: yarn add --dev @seed-design/vite-plugin vite-tsconfig-paths - bun: bun add --dev @seed-design/vite-plugin vite-tsconfig-paths `seedDesignPlugin` handles theming and automatic CSS file loading, etc. ```ts title="vite.config.ts" import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; import { seedDesignPlugin } from "@seed-design/vite-plugin"; // [!code highlight] import tsconfigPaths from "vite-tsconfig-paths"; // [!code highlight] export default defineConfig({ plugins: [ react(), seedDesignPlugin(), // [!code highlight] tsconfigPaths(), // [!code highlight] ], }); ``` #### Plugin Options Without options, color mode follows the user's system settings. To fix it to light or dark, specify `colorMode`. | Option | Type | Default | Description | | ---------------------- | ----------------------------------------- | ---------- | ------------------------------------------------------------------------------ | | `colorMode` | `"system" \| "light-only" \| "dark-only"` | `"system"` | Global color mode. `system` follows the user's OS setting | | `injectColorSchemeTag` | `boolean` | `true` | Whether to inject the `color-scheme` meta tag | | `fontScaling` | `boolean` | `false` | On iOS, whether to scale text according to the user's system text size setting | ```ts title="vite.config.ts" seedDesignPlugin({ colorMode: "light-only", }); ``` How color mode works is covered in [Theming](/react/getting-started/styling/theming). ### Try using a component? ```sh npx @seed-design/cli@latest add ui:action-button ``` *** Learn how to set up the Crispy Stackflow plugin to use Crispy AppScreen.