This repository has been archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
iTwinUI react v2 migration guide
Mayank edited this page Dec 27, 2022
·
24 revisions
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 with the tool (for users outside the iTwin GitHub org)
This wiki page is to document all of the changes occurring to iTwinUI-react with the upcoming version 2. This includes things like component name changes, component structure changes, visual changes, file renames and moves, and deprecation. You can see the changes made to iTwinUI (CSS) recently for CSS v1 at the iTwinUI v1 migration guide. You can see the changes made to iTwinUI variables recently at the iTwinUI variables v1 migration guide.
- πβπ¨ signifies a significant visual change
- β signifies a breaking change that must be updated by users
- 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.
- iTwinUI-react v2 depends on iTwinUI-CSS v1 (β@itwin/itwinui-cssβ: β1.x.xβ) and on the illustrations package ("@itwin/itwinui-illustrations-react": "1.x.x") and the variables package ("@itwin/itwinui-variables": "1.x.x").
- The dependency for the icons package ("@itwin/itwinui-icons-react") has been removed. SVGs are now accessed through the "icons" folder in the "utils" folder.
- The theming method using
useTheme
has been deprecated. Please useThemeProvider
instead. Instructions can be found in the README on the home page of this repository.
To see examples of the components, visit the storybook page.
-
Alert
- β The previously deprecated property
onClick
has been removed and can no longer be used. Instead, useclickableTextProps
.
- β The previously deprecated property
-
Tab
(singular)- β The previously deprecated
HorizontalTab
has been removed and can no longer be used. UseTab
instead. - β The previously deprecated
HorizontalTabProps
has been removed and can no longer be used. UseTabProps
instead.
- β The previously deprecated
-
Checkbox
andRadio
- β The previously deprecated property
checkmarkClassName
has 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
checkmarkStyle
has 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
-
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 formatting for the table header has changed. The first level header should be removed from a table's column definition.
-
Header
- The property
userIcon
has been deprecated. Avatars (previously user icons) can now be part of theactions
property list.
- The property
-
ErrorPage
has been deprecated and is now calledNonIdealState
. UsingNonIdealState
instead ofErrorPage
allows the client bundle to be smaller, as it doesn't have to import all of the images used inErrorPage
. Note thatNonIdealState
has been completely reworked to achieve this goal. Rather than using the propertyerrorType
to select what type of image to show, use the propertysvg
to apply the image of your choosing.-
ErrorPage
>NonIdealState
-
ErrorPageProps
>NonIdealStateProps
-
ErrorPageTypes
has been deprecated. -
ErrorTypeTranslations
has been deprecated.
-
-
Tabs
(plural, container) -HorizontalTabs
andVerticalTabs
have been deprecated. UseTabs
with the appropriate properties.-
HorizontalTabs
>Tabs
(defaults to horizontal, but can also use propertyorientation = 'horizontal'
) -
VerticalTabs
>Tabs
with propertyorientation = 'vertical'
-
HorizontalTabsProps
andVerticalTabsProps
>TabsProps
-
- Theming
-
ownerDocument
has been deprecated fromThemeOptions
. RenderThemeProvider
in the correct document instead.
-
- Typography - Several text components have been deprecated. Use
Text
with the appropriate properties.-
Headline
>Text
with propertyvariant = 'headline'
-
Title
>Text
with propertyvariant = 'title'
-
Subheading
>Text
with propertyvariant = 'subheading'
-
Leading
>Text
with propertyvariant = 'leading'
-
Body
>Text
with propertyvariant = 'body'
-
Small
>Text
with propertyvariant = 'small'
-
-
UserIcon
has been deprecated and is now calledAvatar
.-
UserIcon
>Avatar
-
UserIconProps
>AvatarProps
-
UserIconStatus
>AvatarStatus
-
-
UserIconGroup
has been deprecated and is now calledAvatarGroup
.-
UserIconGroup
>AvatarGroup
-
UserIconGroupProps
>AvatarGroupProps
-
-
Wizard
has been deprecated and is now separated intoStepper
andWorkflowDiagram
.Stepper
is used for the βbasicβ and βlongβ types of wizard.WorkflowDiagram
is used for the βworkflowβ type of wizard. Continue using propertytype
forStepper
.WorkflowDiagram
has no propertytype
as there is only one type β workflow.-
Wizard
>Stepper
orWorkflowDiagram
-
WizardProps
>StepperProps
orWorkflowDiagramProps
-
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
span
that surrounds a button's children. -
Button
no longer passes class names tostartIcon
andendIcon
.
- 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
-
IconButton
no longer passes class names to icon.
-
-
SplitButton
- The html formatting has changed. Previously
SplitButton
was 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
isLoading
to 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
, andisDisabled
to tile.
- Added properties