# Crispy React 2
URL: /react/updates/upgrade/v2
Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/updates/upgrade/v2.mdx
Guide to tasks needed when upgrading to Crispy React 2.
This guide walks you through upgrading to Crispy React 2. For the full set of changes, including new features, see the [Changelog](/react/updates/changelog).
This guide is written for upgrading from `1.2.x` to `2`. If you're on a
version lower than 1.2, follow the [v1 and below upgrade
guide](/react/updates/upgrade/v1) first, then come back to this document.
## Semantic versioning is followed starting from 2.0.0
In 1.x, breaking changes could be introduced in minor versions, but starting from 2.0.0, each package follows semantic versioning and only introduces breaking changes in major versions. The major version is updated to 2 to mark the starting point of semantic versioning compliance.
Not all packages always move to the same major version together. For
example, if a breaking change applies only to the React package with no CSS
changes, each package's version increments independently. Docs and guides
communicate using the React package's version (e.g. "Crispy React 2").
Paths under `@seed-design/css/vars/component/*`, other than `@seed-design/css/vars/component/typography`, are not covered by SemVer guarantees. If the rootage component spec changes, names or structure may change even in a minor or patch release, so we recommend not depending on them directly in app or library code.
***
## Upgrade packages
Upgrade the `@seed-design/*` packages your project uses to at least the versions below.
| Package | Minimum version | Notes |
| ------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------- |
| `@seed-design/css` | `2.1.0` | |
| `@seed-design/react` | `2.0.0` | |
| `@seed-design/stackflow` | `2.0.0` | |
| `@seed-design/tailwind4-theme` | `2.1.0` | |
| `@seed-design/tailwind3-plugin` | `2.1.0` | |
| `@seed-design/vite-plugin` | `2.0.0` | No changes; identical to `1.1.1`. The version was updated to match the major version bump of the `@seed-design/css` peer. |
| `@seed-design/webpack-plugin` | `2.0.0` | No changes; identical to `1.1.0`. The version was updated to match the major version bump of the `@seed-design/css` peer. |
| `@seed-design/rsbuild-plugin` | `2.0.0` | No changes; identical to `1.2.1`. The version was updated to match the major version bump of the `@seed-design/css` peer. |
You only need to upgrade the packages currently used in your project. There's no need to newly install packages you don't use.
- npm: npm install @seed-design/react@latest @seed-design/css@latest @seed-design/stackflow@latest
- pnpm: pnpm add @seed-design/react@latest @seed-design/css@latest @seed-design/stackflow@latest
- yarn: yarn add @seed-design/react@latest @seed-design/css@latest @seed-design/stackflow@latest
- bun: bun add @seed-design/react@latest @seed-design/css@latest @seed-design/stackflow@latest
## Code changes
### Items with design changes
These are items where the on-screen result may change, so a design decision might be needed.
#### 1. Removed gradient tokens `$gradient.fade-layer-*`
\[Judgment call required]
`$gradient.fade-layer-floating` and `$gradient.fade-layer-default` have been removed. If you want a natural fade on a scroll area, use the [Scroll Fog](/react/components/scroll-fog) component instead.
If you're hardcoding Tailwind utility classes or CSS variables, this change
won't be caught as an error. Please search for usages directly.
#### 2. Removed Chip Tabs `variant="brandSolid"`
\[Discoverable via errors]
Please use `variant="neutralSolid"`.
A type error like the following may occur in a branch that existed solely for a deprecation warning in the `seed-design/ui/chip-tabs.tsx` snippet.
```text
This comparison appears to be unintentional because the types
'"neutralSolid" | "neutralOutline" | undefined' and '"brandSolid"' have no overlap. ts(2367)
```
Please re-fetch the snippet or remove that branch.
- npm: npx @seed-design/cli@latest add --on-diff backup ui:chip-tabs
- pnpm: pnpm dlx @seed-design/cli@latest add --on-diff backup ui:chip-tabs
- yarn: yarn dlx @seed-design/cli@latest add --on-diff backup ui:chip-tabs
- bun: bun x @seed-design/cli@latest add --on-diff backup ui:chip-tabs
#### 3. Removed App Bar `divider` option
\[Discoverable via errors]
The bottom divider on the App Bar is no longer displayed. It was removed based on the design decision that area separation is sufficient without a divider or shadow.
#### Note: `$color.bg.layer-fill` color token
This token was originally scheduled for removal in Crispy React 2, but due to the lack of a replacement token, it's now scheduled for removal in 3 instead. It was actually removed in `@seed-design/css`, `tailwind3-plugin`, and `tailwind4-theme` `2.0.0`, but was added back in `2.1.0`.
### Items requiring code changes
#### 1. Buttons inside Snackbar now always close the snackbar
\[Snippet update recommended]
Pressing a button inside a Snackbar now always closes the snackbar. This behavior is now built in by default to `SeedSnackbar.ActionButton` in `@seed-design/react`.
The `shouldCloseOnAction`-related code in the `seed-design/ui/snackbar.tsx` snippet is now redundant. There's no issue with the behavior, but we recommend re-fetching the snippet to remove the redundant logic. The default value of the existing `shouldCloseOnAction` was also `true`.
- npm: npx @seed-design/cli@latest add --on-diff backup ui:snackbar
- pnpm: pnpm dlx @seed-design/cli@latest add --on-diff backup ui:snackbar
- yarn: yarn dlx @seed-design/cli@latest add --on-diff backup ui:snackbar
- bun: bun x @seed-design/cli@latest add --on-diff backup ui:snackbar
#### 2. Layout component props converted to a discriminated union
\[Discoverable via errors]
With the addition of margin support to layout components, the types have been constrained to a discriminated union so that `margin` and `bleed` can't be used at the same time.
Because of this, an `interface` that directly `extends` `BoxProps`, `FlexProps`, `VStackProps`, etc. may need to be converted to a `type`.
```tsx
interface MyBoxProps extends BoxProps {} // [!code --]
type MyBoxProps = BoxProps & {}; // [!code ++]
```
#### 3. Bottom Sheet option cleanup
\[Discoverable via errors]
- Removed `noBodyStyles` and `preventScrollRestoration` from `BottomSheetRoot`: the new scroll lock implementation now behaves like each option's default value (`noBodyStyles: true`, `preventScrollRestoration: false`).
- Removed `direction` from `BottomSheetRoot`: Bottom Sheet now always opens only from the bottom.
- Removed `forceMount` from `BottomSheetBackdrop`
- Can be replaced with `lazyMount` / `unmountOnExit` on `DrawerRoot`.
- Removed `onPointerDownOutside`, `onFocusOutside`, `onInteractOutside`, `onEscapeKeyDown`, `onOpenAutoFocus`, `onCloseAutoFocus`, and `forceMount` from `BottomSheetContent`
- Can be replaced with the second argument, `details`, of `onOpenChange` on `DrawerRoot`.
#### 4. Select Box Checkmark class name and import path
Changed the `selectBoxCheckmark` class name and import path to kebab-case.
**If you're using the selector in a custom stylesheet**
Change the class to kebab-case.
\[Judgment call required]
```css
/* [!code --] */
.seed-selectBoxCheckmark__root {
/* [!code --] */
/* ... */
/* [!code --] */
}
/* [!code --] */
.seed-selectBoxCheckmark__icon {
/* [!code --] */
/* ... */
/* [!code --] */
}
/* [!code ++] */
.seed-select-box-checkmark__root {
/* [!code ++] */
/* ... */
/* [!code ++] */
}
/* [!code ++] */
.seed-select-box-checkmark__icon {
/* [!code ++] */
/* ... */
/* [!code ++] */
}
```
**If you're importing the recipe in a custom component**
Change the path.
\[Discoverable via errors]
```ts
import { selectBoxCheckmark } from "@seed-design/css/recipes/selectBoxCheckmark"; // [!code --]
import { selectBoxCheckmark } from "@seed-design/css/recipes/select-box-checkmark"; // [!code ++]
```
#### 5. Bug fixes and improvements for overlay components
\[Judgment call required]
Fixed bugs related to Alert Dialog, Bottom Sheet, and Menu Sheet.
- All code that blocked clicks via `pointer-events` has been removed. If you had a workaround overriding this, you can remove it as well.
- When a nested overlay closes while multiple overlays are stacked, `onOpenChange` now provides `"cascadeDismiss"` as the reason.
- When a Bottom Sheet opens via a trigger click, `onOpenChange` now provides `"trigger"` as the reason.
- Fixed an issue on iOS where swiping the sheet via a button inside the Bottom Sheet could trigger an unintended click.
- Fixed focus so that when AppScreen or Drawer opens, focus moves into the component and stays trapped within it.
The `@radix-ui/react-dialog` dependency and patch, which didn't work well with the Stackflow environment, have been removed from `@seed-design/react`. If you installed this package in a pnpm environment solely for Crispy React, you can remove it.
```shell
pnpm why @radix-ui/react-dialog
pnpm remove @radix-ui/react-dialog
```
#### 6. Removed some APIs that have replacements
\[Discoverable via errors]
**Removed Image Frame `rounded`**
Please use `borderRadius="r2"`. The style is identical.
```tsx
// [!code --]
// [!code ++]
```
**Removed Switch `size="small" | "medium"`**
Please use `size="16"` and `size="32"` respectively. The styles are identical.
```tsx
// [!code --]
// [!code ++]
// [!code --]
// [!code ++]
```
**Removed Checkbox `weight="default" | "stronger"`**
Please use `weight="regular"` and `weight="bold"` respectively. The styles are identical.
```tsx
// [!code --]
// [!code ++]
// [!code --]
// [!code ++]
```
**Removed camelCase values from layout component props**
camelCase values have been removed from `justifyContent`, `alignItems`, `flexDirection`, `display`, etc. on layout components such as `Box`, `Flex`, `VStack`, and `HStack`. Please use kebab-case values. The styles are identical.
```tsx
// [!code --]
// [!code ++]
```
#### 7. Menu Sheet deprecation notice
The existing Menu Sheet APIs continue to work in Crispy React 2 but are now deprecated. If you're using Menu Sheet for the first time, please use the [Swipeable Menu Sheet](/react/components/swipeable-menu-sheet) component instead.