Getting Started
Migrating to 11.0
11.0 is the first major since versions began to follow semver, so it is the first one that means “something breaks”. Two things changed, and both can be cleared on 10.9, its release candidate, before you upgrade.
Upgrade in two steps
10.9.x was the release candidate for 11.0. Stop there first if you are on an older 10.x, and move every @nexub package you use together:
npm install @nexub/react@10.9 @nexub/themes@10.9 @nexub/tokens@10.9 @nexub/icons@10.910.9 breaks nothing: it is 10.x with the warnings and the codemod rule for 11.0. Run the rule, clear what it finds, and 11.0 is a version bump.
npx nexub-migrate --rules changes-in-11 # dry run: the diff and the items to review
npx nexub-migrate --rules changes-in-11 --write # apply the import rewrites
npx nexub-migrate --rules changes-in-11 --check # CI: exit 1 while anything is leftWhat breaks: the four product theme files
| Removed in 11.0 | Use instead | Codemod |
|---|---|---|
@nexub/themes/leap, @nexub/themes/bookub, @nexub/themes/payub and @nexub/themes/founderub, the hand-written product files. Deprecated in 10.3. | @nexub/themes/products, the generated map. It sets the same accent under data-product for these four and for every other app, so the attribute and ThemeProvider product stay as they are. | changes-in-11 rewrites the import and reports the duplicate lines to delete |
/* before */
@import '@nexub/themes/leap';
@import '@nexub/themes/payub';
/* after: one import covers every product */
@import '@nexub/themes/products';If you import @nexub/react/styles.css and none of the four files yourself, there is nothing to do: the stylesheet moved to the generated map in 11.0.
What changes by default: overlays on small screens
Since 10.6 pickers and menus can open as a bottom sheet with the sheet prop. In 11.0 its default went from false to "auto": a bottom sheet below 768px, the usual popover above. For poppers it is done in CSS, so nothing flashes after hydration; AlertDialog and CommandPalette switch right after mount.
| Package | Components with the prop |
|---|---|
@nexub/react | Select.Content, MultiSelect, Autocomplete, DatePicker, DateRangePicker, DateTimePicker, DropdownMenu.Content, ContextMenu.Content, Menubar.Content, Popover.Content, SplitButton, SavedViews, Breadcrumb.Trail, AlertDialog.Content, CommandPalette |
@nexub/patterns | NotificationCenter, AppLauncher, AppHeader |
<Select.Content sheet="auto">…</Select.Content> {/* the 11.0 default, written out */}
<Select.Content sheet={false}>…</Select.Content> {/* keep a popover on small screens */}The codemod does not rewrite these, because either answer can be right. It reports each overlay that passes no sheet prop; look at the screen on a phone and choose. See Select for the sheet layout.
New since 10.2, worth adopting
All of it is additive and already in 10.x.
| Version | What it added |
|---|---|
| 10.3 | Vivid on app surfaces: page headers, StatCard, sidebar, rows and charts (Expression). ThemeProvider product accepts every product in the map. |
| 10.4 | One size scale (sm, md, lg) on every control, invalid on the non-text controls and readOnly on every input. |
| 10.5 | loading, emptyState and errorState on every data component, Skeleton presets, Illustration and the StatusPage pattern. |
| 10.6 | The sheet prop, poppers that stay on screen, a Sidebar that collapses at a breakpoint, and layouts that follow their container. |
| 10.7 | Interactive charts, day and agenda views in EventCalendar, table density and sticky headers, DataTable footers and column filters, Truncate, DescriptionList, ComparisonBar and StatusSteps. |
| 10.8 | Twelve page templates (sign-up, verify code, onboarding, table page, booking, invoice and more), PhoneInput, Countdown and TimeSlotPicker. |
| 10.9 | React Native: the 10.3 look and the product map, gestures on the UI thread (react-native-gesture-handler becomes a required peer), new twins, tablet layouts. And this guide, the codemod rule and the notices for 11.0. |
Postponed to the major after 11
The plan for 11.0 also listed removing sizes outside the shared scale and aligning the web and native variant names. Neither was deprecated in a 10.x release, and a major removes only what an earlier minor deprecated, with at least one release in between. So they are not in 11.0. They will be deprecated in an 11.x minor first, with a codemod, and removed in the major after.
Coming from 9.x
Migrating to 10.0 first: it removes nothing, so it is a version bump. Then this page.