# Installation
URL: /lynx/getting-started/installation
Source: https://github.com/daangn/seed-design/blob/dev/docs/content/lynx/getting-started/installation.mdx
Learn how to install and use Crispy in a Lynx project.
### Install Dependencies
Install the required common dependencies. Choose the styling library in the next step.
- npm: npm install @seed-design/lynx-react @seed-design/lynx-css
- pnpm: pnpm add @seed-design/lynx-react @seed-design/lynx-css
- yarn: yarn add @seed-design/lynx-react @seed-design/lynx-css
- bun: bun add @seed-design/lynx-react @seed-design/lynx-css
### Choose a Styling Library
**Choose between Vanilla Extract or Tailwind CSS v4 that suits your project.**
See the [Styling Guide](/lynx/getting-started/styling) for why we recommend static CSS and layout examples.
| Styling Method | How to Write | Configuration Guide |
| --------------- | ------------------------------------------------ | ---------------------------------------------------------------- |
| Vanilla Extract | Write typed styles and Crispy tokens in `.css.ts`. | [Vanilla Extract](/lynx/getting-started/styling/vanilla-extract) |
| Tailwind CSS v4 | Combine utility classes in `className`. | [Tailwind CSS 4](/lynx/getting-started/styling/tailwind-css-4) |
After applying dependencies, build settings, Crispy `base.css`, and CSS imports in app entry from the chosen guide, proceed to the next step.
First check the Rspeedy and Rsbuild requirements in each guide. Vanilla Extract plugin `0.2.0` requires Rsbuild 1,
and the Tailwind v4 guide covers Rsbuild 2-based configuration.
Existing Tailwind v3 projects can maintain the [Tailwind CSS 3](/lynx/getting-started/styling/tailwind-css-3) configuration.
### Create seed-design.json
### Run the init command
- npm: npx @seed-design/cli init
- pnpm: pnpm dlx @seed-design/cli init
- yarn: yarn dlx @seed-design/cli init
- bun: bun x @seed-design/cli init
### Configure seed-design
If `@lynx-js/react` is installed, the framework is automatically detected as Lynx.
```sh
◇ Are you using TypeScript?
│ Yes
│
◇ Which framework are you using?
│ Lynx
│
◇ Enter the path for the seed-design folder. (Default: created at project root.)
│ ./seed-design
│
◇ Collect anonymous usage data for improvements?
│ Yes
```
Create the file below at your project root.
```json title="seed-design.json"
{
"tsx": true,
"framework": "lynx",
"path": "./seed-design"
}
```
### Configure seed-design path alias
Must be the same as the path configured in [seed-design.json path](/react/getting-started/cli/configuration#path) above.
Add a path alias to the root `tsconfig.json` so TypeScript can interpret snippet imports.
```json title="tsconfig.json"
{
"compilerOptions": {
// ... your options
"baseUrl": ".",
"paths": {
// [!code highlight]
"seed-design/*": [
// [!code highlight]
"./seed-design/*"
]
}
}
}
```
If you have a separate `src/tsconfig.json` like the Lynx template and use a `composite` project, you must also add the generated snippet path to include.
```json title="src/tsconfig.json"
{
"include": [
"./**/*.ts",
"./**/*.tsx",
"../seed-design/**/*.ts",
"../seed-design/**/*.tsx"
]
}
```
Rspeedy/Rspack also needs to know the same alias to interpret `seed-design/*` imports in runtime build.
```ts title="lynx.config.ts"
import { defineConfig } from "@lynx-js/rspeedy";
import { fileURLToPath } from "node:url";
const seedDesignDir = fileURLToPath(new URL("./seed-design", import.meta.url));
export default defineConfig({
resolve: {
alias: {
"seed-design": seedDesignDir,
},
},
});
```
If using `@karrotmarket/lynx-*-icon` icon package, you must also configure
`@seed-design/rsbuild-plugin-lynx-icon` to display SVG assets in Lynx.
For detailed configuration, see [Iconography](/lynx/foundation/iconography#rsbuild-plugin-configuration).
### Configure Lynx Feature Flags
This is the basic configuration for Crispy's CSS inheritance, inline variables, Dynamic/Static typography, and fixed elements.
CSS Selector and Invalidation use the default values of `pluginReactLynx`, so you don't need to set them repeatedly.
The example below uses options allowed in React plugin `0.18.3` and `0.20.2`, config plugin `0.2.2` and `0.2.3`.
- npm: npm install @lynx-js/config-rsbuild-plugin
- pnpm: pnpm add @lynx-js/config-rsbuild-plugin
- yarn: yarn add @lynx-js/config-rsbuild-plugin
- bun: bun add @lynx-js/config-rsbuild-plugin
```ts title="lynx.config.ts"
import { defineConfig } from "@lynx-js/rspeedy";
import { pluginReactLynx } from "@lynx-js/react-rsbuild-plugin";
import { pluginLynxConfig } from "@lynx-js/config-rsbuild-plugin";
export default defineConfig({
plugins: [
pluginReactLynx({
engineVersion: "3.6",
}),
// ... existing plugins
pluginLynxConfig({
enableCSSInheritance: true,
enableCSSInlineVariables: true,
fontScaleEffectiveOnlyOnSp: true,
enableFixedNew: true,
}),
],
});
```
Combine options with existing `pluginReactLynx` calls, and do not register the same plugin twice.
`engineVersion` is the minimum target version of your app. If your existing app requires a higher version, maintain that value.
`enableTextRefactor` is enabled by default in this target version, and you don't need to add `enableCSSStrictMode: false` as a required Crispy setting.
Check [Feature
Flags](/lynx/getting-started/feature-flags) for settings to maintain or omit by engine and build tool version, and optional settings.
### Try using a component
- npm: npx @seed-design/cli add ui:switch
- pnpm: pnpm dlx @seed-design/cli add ui:switch
- yarn: yarn dlx @seed-design/cli add ui:switch
- bun: bun x @seed-design/cli add ui:switch
### (Optional) Install lynx-console
[lynx-console](https://github.com/daangn/lynx-console) is a developer tool that lets you check console logs, network, and performance metrics inside your Lynx app.
- npm: npm install lynx-console
- pnpm: pnpm add lynx-console
- yarn: yarn add lynx-console
- bun: bun add lynx-console
Initialize it in your app entry and add the component.
```tsx title="src/App.tsx"
import {
initLogMonitor,
initMainThreadConsole,
initNetworkMonitor,
initPerformanceMonitor,
} from "lynx-console/setup";
import LynxConsole from "lynx-console";
initLogMonitor();
initMainThreadConsole();
initNetworkMonitor();
initPerformanceMonitor();
function App() {
return (
{/* your app */}
);
}
```
See [lynx-console GitHub](https://github.com/daangn/lynx-console) for detailed usage.