Installation
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.
Choose a Styling Library
Choose between Vanilla Extract or Tailwind CSS v4 that suits your project. See the Styling Guide 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 |
| Tailwind CSS v4 | Combine utility classes in className. | 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 configuration.
Create seed-design.json
Configure seed-design
If @lynx-js/react is installed, the framework is automatically detected as Lynx.
Configure seed-design path alias
Must be the same as the path configured in seed-design.json path above.
Add a path alias to the root tsconfig.json so TypeScript can interpret snippet imports.
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.
Rspeedy/Rspack also needs to know the same alias to interpret seed-design/* imports in runtime build.
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.
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.
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 for settings to maintain or omit by engine and build tool version, and optional settings.
(Optional) Install lynx-console
lynx-console is a developer tool that lets you check console logs, network, and performance metrics inside your Lynx app.
Initialize it in your app entry and add the component.
See lynx-console GitHub for detailed usage.