id | section |
---|---|
Upgrade guide |
developer-resources |
Hey, Flyers! We’ve been busy for the past 12 weeks keeping up with changes to PatternFly’s HTML and CSS. We’ve replaced babel
with tsc
as our compiler of choice and removed prop-types in favor of using our .d.ts
types, which are supported in most editors.
This upgrade guide details what was broken and how to fix it. To learn why a change was made, check out the linked pull requests.
- We no longer support UMD builds for individual packages. Consider using our react-core.umd.js bundle instead. (#4076)
- We no longer define
propTypes
for our components. Consider using our Typescript types under each package'sdist/js
folder instead. (#4076) - We have updated our React peer dependencies so that our packages now can possibly use hooks, which requires
react@^16.8.0
instead ofreact@^16.4.0
. We recommend upgrading your version of React if it is below 16.8.0.
- Major changes include removing the
Toolbar
layout in favor of a newPageHeaderTools
component.DataToolbar
has been renamedToolbar
.Expandable
has been renamedExpandableSection
.
- AboutModalContainer:
- Removed prop
ariaLabelledbyId
in favor ofaboutModalBoxHeaderId
- Removed prop
ariaDescribedById
in favor ofaboutModalBoxContentId
- Removed prop
- Removed prop
noBoxShadow
. If a shadow is needed, the accordion can be placed in a card, or a shadow can be applied either using CSS or a box-shadow utility class. (#4022)
- Changed default variant to
default
. To maintain current default behavior, set thevariant
property toinfo
. (#3903). - If you were previously using the
action
prop for the close button, use theactionClose
prop instead (#4190) - If you were previously using the
action
prop for a link button, use theactionLinks
prop instead (#4190)
- Removed deprecated prop
dropdownItems
. the propitems
should be used instead (#3929)
- Replaced
[BackgroundImageSrc.{sm,xs2x,sm,sm2x,lg}]
with strings'sm' | 'xs2x' | 'sm' | 'sm2x' | 'lg'
(#3886) - Removed always ignored
[BackgroundImageSrc.filter]
for newfilter
prop of typeReactNode
(#3886)
- Removed props
isHover
andisFocus
(#4116)
- CardHeader:
- Renamed to CardTitle (#4170)
- CardHeadMain:
- Renamed to CardHeaderMain (#4170)
- CardHead:
- Renamed to CardHeader (#4170)
- Chip:
- The overflow chip no longer contains a button. To specify an overflow chip as a button do use
<Chip component='button' isOverflowChip>Chip</Chip>
(#4246)
- The overflow chip no longer contains a button. To specify an overflow chip as a button do use
- ChipGroup :
- ChipGroupToolbarItem: This component has been removed in favor of
<ChipGroup categoryName="name">
. All props that were on the<ChipGroupToolbarItem>
have been added to<ChipGroup>
. To use the new API, move props from<ChipGroupToolbarItem>
to<ChipGroup>
. (#4246)
- ContextSelectorItem:
- Removed prop
isHover
(#4116)
- Removed prop
- ContextSelectorToggle:
- Removed props
isHovered
andisFocused
(#4116)
- Removed props
- Renamed
noPadding
tohasNoPadding
. (#4133)
- Removed promoted component from experimental index file. Change import path from
import { Divider } from '@patternfly/react-core/dist/esm/experimental';
to'import { Divider } from '@patternfly/react-core/dist/esm/components';
(#4029).
- Renamed
noPadding
tohasNoPadding
. (#4133) - Removed import path
'@patternfly/react-core/dist/js/experimental'
. The import path'@patternfly/react-core'
should be used instead. (#4176)
- Dropdown:
- DropdownToggle:
- Removed prop
ariaHasPopup
in favor ofaria-haspopup
- Renamed
iconComponent
totoggleIndicator
(#4038)
- Removed prop
- DropdownItemIcon:
- This component has been removed in favor of
<DropdownItem icon={<Icon />} />
(#4147)
- This component has been removed in favor of
- EmptyState
- EmptyStateIcon:
- Removed deprecated
size
andtitle
from IconProps.
- Removed deprecated
- Renamed component to
ExpandableSection
(#4116) - Removed props
isFocus
andisHovered
from ExpandableSection (#4116)
- Flex:
- Removed
breakpointMods
prop in favor ofspacer
,spaceItems
,grow
,shrink
,flex
,direction
,alignItems
,alignContent
,alignSelf
,align
,justifyContent
,display
,fullWidth
andflexWrap
(#4310)
- Removed
- FlexItem:
- Removed
breakpointMods
prop in favor ofspacer
,grow
,shrink
,flex
,alignSelf
,align
, andfullWidth
(#4310)
- Removed
- Removed boolean
isValid
prop in favor ofvalidated?: 'default' | 'success' | 'error' | ValidatedOptions;
. Update your boolean logic to use the new 'default' or 'error' options instead. (#3975)
- Removed prop
gutter
in favor ofhasGutter
(#4014)
- Removed prop
gutter
in favor ofhasGutter
(#4014)
- Removed prop
isCompact
from Label (#4116) - Default color changed to grey. Design also adjusted. (#4165)
- Removed prop
gutter
in favor ofhasGutter
(#4014)
- LoginForm:
- Removed prop
rememberMeAriaLabel
(#3924)
- Removed prop
- Modal
- Collapsed the
isLarge
andisSmall
properties into a singlevariant
property. To maintain the current behavior, set thevariant
property tolarge
orsmall
, or use the newly addedModalVariant
enum asModalVariant.large
orModalVariant.small
. (#3920) - Removed prop
ariaDescribedById
in favor ofmodalContentAriaDescribedById
(#3924) - Removed prop
isFooterLeftAligned
. This prop is now always enabled and cannot be opted out of. (#4017) - Removed prop
hideTitle
. To hide the Modal header, do not pass a title prop, a description prop, or a header prop. If there is no title or header passed, provide anaria-label
prop to the Modal component to make it accessible. (#4140)
- Collapsed the
- ModalContent:
- Removed prop
ariaDescribedById
in favor ofmodalBoxAriaDescribedById
- Removed prop
- ModalFooter:
- Removed prop
isLeftAligned
(#4017)
- Removed prop
- Nav:
- Changed default theme to dark. To use the light variant, use
theme="light"
. (#4116)
- Changed default theme to dark. To use the light variant, use
- NavList:
- Removed prop
variant
. Passvariant="horizontal"
orvariant="tertiary"
toNav
instead. (#4225)
- Removed prop
- OptionsMenu:
- Removed prop
ariaLabelMenu
.
- Removed prop
- OptionsMenuItemGroup:
- Removed prop
ariaLabel
in favor ofaria-label
- Removed prop
- OptionsMenuToggleWithText:
- Removed prop
ariaHasPopup
in favor ofaria-haspopup
- Removed props
isFocused
andisHovered
(#4116)
- Removed prop
- OptionsMenuToggle:
- Removed props
isFocused
andisHovered
(#4116)
- Removed props
- Page:
- Made mainContainerId a required property for skip to content component (#3904)
- Changed default theme to dark. Use
theme="light"
if you wish to use the light variant. (#4116) - Renamed
noPadding
tohasNoPadding
. (#4133) - Removed prop
hasNoPadding
in favor ofpadding={{ default: 'noPadding' }}
to prevent conflicts when setting bothhasNoPadding
andpadding={{ default: 'padding' | 'noPadding' }}
(#4310)
- PageSection:
- PageHeader:
- Removed prop
avatar
. Add the avatar to thePageHeaderTools
component instead (which is passed intoPageHeader
via theheaderTools
prop) (#4223) - Removed prop
toolbar
. Use theheaderTools
prop instead. Also, if you previously used theToolbar
,ToolbarGroup
, orToolbarItem
components for the header, replace them with thePageHeaderTools
,PageHeaderToolsGroup
, andPageHeaderToolsItem
components. (#4223)
- Removed prop
- Removed obsolete 'left' and 'right' variants. These should be replaced with 'top' (default) or 'bottom'. (#4202)
- PopoverHeader:
- Title size now defaults to medium instead of extra large (#4030)
- Progress:
- Removed deprecated
ProgressVariant.info
that adds no styling. Do not pass this prop or passnull
instead. (#3886)
- Removed deprecated
- ProgressBar:
- Removed prop
ariaProps
in favor ofprogressBarAriaProps
(#3924)
- Removed prop
- ProgressContainer:
- Removed prop
ariaProps
in favor ofprogressBarAriaProps
(#3924)
- Removed prop
- Select:
- Removed prop
ariaLabelledBy
in favor ofaria-labelledby
(#3924) - Removed prop
ariaLabelTypeAhead
in favor oftypeAheadAriaLabel
(#3924) - Removed prop
ariaLabelClear
in favor ofclearSelectionsAriaLabel
(#3924) - Removed prop
ariaLabelToggle
in favor oftoggleAriaLabel
(#3924) - Removed prop
ariaLabelRemove
in favor ofRemovedelectionAriaLabel
(#3924) - Renamed
isExpanded
property toisOpen
(#3945) - Removed deprecated
CheckboxSelect
andCheckboxSelectOption
in favor ofvariant="checkbox"
- Removed prop
- SelectOption:
- Removed prop
isFocus
(#4116)
- Removed prop
- SelectToggle
- Removed
component
prop in favor of always using an anchor tag (#4116)
- Removed prop
gutter
in favor ofhasGutter
(#4014)
- Removed prop
gutter
in favor ofhasGutter
(#4014)
- Tab:
- The title should be wrapped with
<TabTitleText>
for proper styling. If you would like to place an icon in the tab, it should be wrapped with<TabTitleIcon>
for proper styling. (#4146)
- The title should be wrapped with
- Tabs:
- Updated onSelect type from
(event: React.ChangeEvent<HTMLInputElement>) => void
to(event: React.FormEvent<HTMLInputElement>) => void
(#3296) - Removed
cellHeightAuto
transformer (#4170) cellWidth('max')
has been replaced withcellWidth(100)
(#4170)
- Removed boolean
isValid
prop in favor ofvalidated?: 'default' | 'success' | 'error' | ValidatedOptions;
. Update your boolean logic to use the new 'default' or 'error' options instead. (#3975)
- Removed boolean
isValid
prop in favor ofvalidated?: 'default' | 'success' | 'error' | ValidatedOptions;
. Update your boolean logic to use the new 'default' or 'error' options instead. (#3975)
- Make
headingLevel
required and remove default ofh2
to improve accessibility (#3922) - Removed enum
TitleLevel
. Use one of the string valuesh1
,h2
,h3
,h4
,h5
, orh6
instead. - Heading levels should be set contextually and and always be increasing or decreasing by 1 when read top-to-bottom in the DOM.
- Rename enum
TitleSize
toTitleSizes
(#3922) - Removed invalid values
xs
andsm
forsize
prop. Use sizemd
instead.
- Toolbar:
- ToolbarItem:
- Removed
breakpointMods
prop in favor ofvisibility
,alignment
, andspacer
(#4310)
- Removed
- ToolbarToggleGroup:
- Removed
breakpointMods
prop in favor ofvisibility
,alignment
,spacer
, andspaceItems
(#4310)
- Removed
-
Wizard
- Removed prop
ariaLabelNav
in favor ofnavAriaLabel
(#3924) - Removed prop
ariaLabelCloseButton
in favor ofcloseButtonAriaLabel
(#3924) - Removed props
isFullHeight
andisFullWidth
(#4116) - Renamed prop
hasBodyPadding
tohasNoBodyPadding
. (#4136) - Removed
inPage
prop. By default the wizard will be displayed in page, filling its parent container. If the consumer passes a managedisOpen
flag then the wizard will be displayed in a modal. (#4140)
- Removed prop
-
WizardBody:
- Renamed
hasBodyPadding
tohasNoBodyPadding
. (#4136)
- Renamed
-
WizardHeader:
- Removed prop
ariaLabelCloseButton
in favor ofcloseButtonAriaLabel
(#3924)
- Removed prop
-
WizardNav:
-
WizardNavItem:
- Renamed prop
text
tocontent
. The type of the prop has been changed toReact.ReactNode
to allow for flexibility. (#4063)
- Renamed prop
- Updated Victory to package versions to 34.3.9 (#3974)
- Removed the
@types/victory
dependency and updated the PatternFly charts to use the types introduced with Victory 34.x. (#4138) - Updated label prop types to sync with Victory 34.3.9 (#4152)
- Use
containerComponent={<VictoryZoomComponent />}
with Chart instead ofallowZoom
. (#4278) - Use
containerComponent={<VictoryZoomComponent />}
with ChartGroup instead ofallowZoom
. (#4278) - The
allowTooltip
prop was removed fromChartVoronoiContainer
because Victory always provides a default tooltip.
- Updated types.
- Removed
OutlinedFontAwesomeLogoFullIcon
. (#3978)
- Changed and added many types while converting this project to TypeScript. (#4073)
- Removed all exports except for the
css
function and CSS-in-JS stylesheets in thecss
folder since we no longer useemotion
. To use these functions, import directly fromemotion
instead. (#3886)
- Removed tokens
global_BackgroundColor_150
andglobal_BackgroundColor_300
(see associated Core PR). At the discretion of design, useglobal_BackgroundColor_200
with its new value#f0f0f0
instead. - Updated some of our tokens' values to be correct. (#4058)
- Added new files with a different structure to the index. (#4058)