iTwinUI react v2 migration guide - iTwin/iTwinUI GitHub Wiki
To help with the migration (for breaking changes), we also provide a semi-automated migration tool that scans your project repo for old code and recommends replacements.
Download options:
- Clone iTwinUI-migration-tool GitHub repo (recommended)
- Download zip file (version: 08 May 2025) with the tool (for users outside the iTwin GitHub org)
This wiki page is to document all of the changes occurring to iTwinUI-react v2. This includes things like component name changes, component structure changes, visual changes, file renames and moves, and deprecation.
- πβπ¨ signifies a significant visual change
- β signifies a breaking change that must be updated by users
There are also migration guides available for the other two iTwinUI packages:
- iTwinUI-css v1 migration guide (v0 -> v1)
- iTwinUI-variables v1 migration guide (Sass variables -> CSS variables)
- We have officially ended support of Internet Explorer. If you still need IE support, please contact the team or make an issue.
- πβπ¨ The prioritized font has changed. The sans font now prioritizes 'Noto Sans' and the mono font now prioritizes 'Noto Sans Mono'. The previous fonts have not been deprecated. See the updated list here.
- πβπ¨ Line height has changed from 22px to
--iui-size-l(24px). This change visually affects most components. - πβπ¨ All four theme colors have been updated.
- The base themes (light and dark) meet WCAG AA contrast score.
- The high contrast themes (high contrast light and high contrast dark) meet WCAG AAA contrast score.
As of the latest 2.x version, iTwinUI-react no longer depends on: @itwin/itwinui-icons-react, @itwin/itwinui-css, @itwin/itwinui-variables.
- iTwinUI components that internally need SVGs will inline them. If you need to use one of our icons in your app, please manually install the latest
@itwin/itwinui-icons-reactpackage. - Prior to v2.12.0, iTwinUI-react had direct dependencies on
@itwin/itwinui-css@1.x,@itwin/itwinui-variables@2.x. In v2.12.0, these dependencies were removed, and the CSS produced by both of these packages is inlined into iTwinUI-react. -
@itwin/itwinui-illustrations-reactis only used in the now-deprecatedErrorPageand will be removed in the next major version. If you need to use the illustrations standalone, please install the package manually. If you are usingErrorPage, please consider usingNonIdealStateinstead.
- The theming method using
useThemehas been deprecated. Please useThemeProviderinstead. Instructions can be found in the README.
It may not be feasible for your app to upgrade entirely to iTwinUI v2 all at once. To alleviate this, we have added the ability to incrementally migrate to v2 for parts of your app, while still using v1 for the rest of the page.
To use this feature, make sure all parts that use v1 are updated to at least @itwin/[email protected] - you might need (p)npm overrides to do this. Then install @itwin/[email protected] (or later), and wrap your v2 parts in ThemeProvider.
<body>
<!-- rest of your app (v1) -->
<ThemeProvider>
<!-- new UI built using v2 -->
</ThemeProvider>
</body>When designing a package that uses iTwinUI v2 but is intended to be used by apps that might still be using iTwinUI v1 elsewhere, make sure to wrap all entrypoints of your package with <ThemeProvider theme='inherit'>.
<ThemeProvider theme='inherit'>
<!-- package entrypoint -->
</ThemeProvider>For more details and a demo, see "iTwinUI 1.x and 2.x coexisting".
iTwinUI now uses rem units instead of px for spacing. Doing this allows the components to automatically scale with the base font size specified by the end user's operating system and/or browser settings. However, for this to work, your page must not use a constant pixel value for the font-size of the root element.
html {
font-size: 14px; // β don't do this
}If there is a font-size already set on the root element (perhaps through some third-party styles), then you can unset it or use 100%.
html {
font-size: 100% !important;
}And if you would like to control the size of most text on the page, you can still do so by setting it on the body, as it will get inherited by every element on the page.
body {
font-size: 0.875rem;
}To see examples of the components, visit the storybook page.
-
Table- β The formatting for the table header has changed. The first level header should be removed from a table's column definition.
- Previous format:
[{ Header: '', columns: [ ...columns info... ] }] - New format:
[ ...columns info... ]
- Previous format:
- The old format will also continue to work if you update to version
2.5.0or later.
- β The formatting for the table header has changed. The first level header should be removed from a table's column definition.
-
Alert- β The previously deprecated property
onClickhas been removed and can no longer be used. Instead, useclickableTextProps.
- β The previously deprecated property
-
Tab(singular)- β The previously deprecated
HorizontalTabhas been removed and can no longer be used. UseTabinstead. - β The previously deprecated
HorizontalTabPropshas been removed and can no longer be used. UseTabPropsinstead.
- β The previously deprecated
-
CheckboxandRadio- β The previously deprecated property
checkmarkClassNamehas been removed and can no longer be used. This is applied on the actual checkbox/radio<input>element. The checkmark has been moved into a pseudo-element. - β The previously deprecated property
checkmarkStylehas been removed and can no longer be used. This is applied on the actual checkbox/radio<input>element. The checkmark has been moved into a pseudo-element.
- β The previously deprecated property
-
Header- The property
userIconhas been deprecated. Avatars (previously user icons) can now be part of theactionsproperty list.
- The property
-
ErrorPagehas been deprecated and is now calledNonIdealState. UsingNonIdealStateinstead ofErrorPageallows the client bundle to be smaller, as it doesn't have to import all of the images used inErrorPage. Note thatNonIdealStatehas been completely reworked to achieve this goal. Rather than using the propertyerrorTypeto select what type of image to show, use the propertysvgto apply the image of your choosing.-
ErrorPage>NonIdealState -
ErrorPageProps>NonIdealStateProps -
ErrorPageTypeshas been deprecated. -
ErrorTypeTranslationshas been deprecated.
-
-
Tabs(plural, container) -HorizontalTabsandVerticalTabshave been deprecated. UseTabswith the appropriate properties.-
HorizontalTabs>Tabs(defaults to horizontal, but can also use propertyorientation = 'horizontal') -
VerticalTabs>Tabswith propertyorientation = 'vertical' -
HorizontalTabsPropsandVerticalTabsProps>TabsProps
-
- Theming
-
ownerDocumenthas been deprecated fromThemeOptions. RenderThemeProviderin the correct document instead.
-
- Typography - Several text components have been deprecated. Use
Textwith the appropriate properties.-
Headline>Textwith propertyvariant = 'headline' -
Title>Textwith propertyvariant = 'title' -
Subheading>Textwith propertyvariant = 'subheading' -
Leading>Textwith propertyvariant = 'leading' -
Body>Textwith propertyvariant = 'body' -
Small>Textwith propertyvariant = 'small'
-
-
UserIconhas been deprecated and is now calledAvatar.-
UserIcon>Avatar -
UserIconProps>AvatarProps -
UserIconStatus>AvatarStatus
-
-
UserIconGrouphas been deprecated and is now calledAvatarGroup.-
UserIconGroup>AvatarGroup -
UserIconGroupProps>AvatarGroupProps
-
-
Wizardhas been deprecated and is now separated intoStepperandWorkflowDiagram.Stepperis used for the βbasicβ and βlongβ types of wizard.WorkflowDiagramis used for the βworkflowβ type of wizard. Continue using propertytypeforStepper.WorkflowDiagramhas no propertytypeas there is only one type β workflow.-
Wizard>StepperorWorkflowDiagram -
WizardProps>StepperPropsorWorkflowDiagramProps -
WizardLocalization>StepperLocalization
-
-
Alert- The html formatting has changed for the close button. Previously the close button was composed of an
IconButton, but is now made with<button/>. Additionally, the icon now has the class name 'iui-alert-button-icon'.
- The html formatting has changed for the close button. Previously the close button was composed of an
-
Button- The class name "iui-button-label" has been removed from the
spanthat surrounds a button's children. -
Buttonno longer passes class names tostartIconandendIcon.
- The class name "iui-button-label" has been removed from the
- ComboBox
- The virtualized combobox menu now applies a class name of 'iui-scroll' to the menu. This is also where class names can now be applied to the virtualized combobox menu.
-
Header- The html formatting has changed for the header's breadcrumbs. The breadcrumbs are now represented as
<li/>and are surrounded by a container<ol/>.
- The html formatting has changed for the header's breadcrumbs. The breadcrumbs are now represented as
-
IconButton-
IconButtonno longer passes class names to icon.
-
-
SplitButton- The html formatting has changed. Previously
SplitButtonwas formatted with<span> <div> <Button/> </div> <div> <DropdownMenu/> </div> </span>but now the divs have been dropped so that the formatting is now<span <Button/> <DropdownMenu/> </span>.
- The html formatting has changed. Previously
- πβπ¨
Alert: Visuals have changed to meet accessibility requirements. Sticky alert is now offset from top and sides of the window. - πβπ¨
SideNavigation: Visuals have changed. - πβπ¨
Table,Checkbox, &Tile: Visual styling for disabled and loading are now the same acrossTable,Checkbox, andTile. - πβπ¨
Toast: Visuals have changed. - πβπ¨
Tree: No longer transparent and has a background.
-
Table- Added property
isLoadingto table rows. - Added counter to paginated tables that shows how many rows have been selected if multi-selection mode is enabled.
- Updated keyboard navigation support for sorting and filtering.
- Added property
-
Tile- Added properties
status,isLoading, andisDisabledto tile.
- Added properties