Material Tailwind React 3.0 introduces a number of breaking changes, improvements and new features to make the library more flexible and easier to use.
Below is a list of all breaking changes and how to migrate your code to the new version.
The withMT()
function is removed and doesn't work anymore, instead you can use the mtConfig
as plugin in your tailwind.config.js
file.
On v3
you don't need to wrap your application with the <ThemeProvider />
component anymore. You only need to do this if you want to use custom theme and style for your components.
On v3
we dropped Framer Motion and components are not animated by default anymore. You can still use Framer Motion or any other animation library to animate your components.
This helps to reduce the bundle size, improve the performance and make the components more flexible to be used with any animation library.
On v3
we reduced the amount of colors used for the components, this helps to make a consistent color palette across the components and make it easier to manage the colors.
On v3
the values for variant
prop is changed.
On v3
the fullWidth
prop is replaced with isFullWidth
prop.
The following components are removed from the library.
The <Carousel />
component is removed, instead we added a complete integration of Swiper with Material Tailwind, check the integration here.
The <Navbar />
component is removed, instead you can use <Card />
with <Collapse />
components to create a navbar, check the Navbar Documentation.
The <SpeedDial />
component is removed, instead you can use <Tooltip />
with <IconButton />
components to create a similar effect, check the Speed Dial Documentation.
The <Stepper />
component is removed, instead you can use <Timeline />
component to create a similar effect, check the Stepper Documentation.
The <Accordion />
component is completely rewritten to make it more flexible and easier to use. Now <Accordion />
component works as both controlled and uncontrolled component, where you don't need to manage the open and close state by default, but you can still manage it if you want as a controlled component.
Below check the <Accordion />
component anatomy.
For more information about the <Accordion />
component, check the Accordion Documentation.
The <Alert />
component is completely rewritten to make it more flexible and easier to use. Now <Alert />
component works as both controlled and uncontrolled component, where you don't need to manage the open and close state by default, but you can still manage it if you want as a controlled component.
Below check the <Alert />
component anatomy.
For more information about the <Alert />
component, check the Alert Documentation.
The name <Breadcrumbs />
is changed to <Breadcrumb />
and the component is completely rewritten to make it more flexible and easier to use.
Below check the <Breadcrumb />
component anatomy.
For more information about the <Breadcrumb />
component, check the Breadcrumb Documentation.
The <Checkbox />
component is completely rewritten to make it more flexible and easier to use.
Below check the <Checkbox />
component anatomy.
For more information about the <Checkbox />
component, check the Checkbox Documentation.
The <Chip />
component is completely rewritten to make it more flexible and easier to use. Now <Chip />
component works as both controlled and uncontrolled component, where you don't need to manage the open and close state by default, but you can still manage it if you want as a controlled component.
Below check the <Chip />
component anatomy.
For more information about the <Chip />
component, check the Chip Documentation.
The <Dialog />
component is completely rewritten to make it more flexible and easier to use. Now <Dialog />
component works as both controlled and uncontrolled component, where you don't need to manage the open and close state by default, but you can still manage it if you want as a controlled component.
Below check the <Dialog />
component anatomy.
For more information about the <Dialog />
component, check the Dialog Documentation.
The <Drawer />
component is completely rewritten to make it more flexible and easier to use. Now <Drawer />
component works as both controlled and uncontrolled component, where you don't need to manage the open and close state by default, but you can still manage it if you want as a controlled component.
Below check the <Drawer />
component anatomy.
For more information about the <Drawer />
component, check the Drawer Documentation.
The <Input />
component is completely rewritten to make it more flexible and easier to use.
Below check the <Input />
component anatomy.
For more information about the <Input />
component, check the Input Documentation.
The <Progress />
component is completely rewritten to make it more flexible and easier to use.
Below check the <Progress />
component anatomy.
For more information about the <Progress />
component, check the Progress Bar Documentation.
The <Radio />
component is completely rewritten to make it more flexible and easier to use.
Below check the <Radio />
component anatomy.
For more information about the <Radio />
component, check the Radio Documentation.
The <Select />
component is completely rewritten to make it more flexible and easier to use. Now <Select />
component works as native html select element, where you can access it's value using form data.
Below check the <Select />
component anatomy.
For more information about the <Select />
component, check the Select Documentation.
The <Tabs />
component is completely rewritten to make it more flexible and easier to use. Now you can access the indicator for the active tab as an independent component.
Below check the <Tabs />
component anatomy.
For more information about the <Tabs />
component, check the Tabs Documentation.
The <Timeline />
component is completely rewritten to make it more flexible and easier to use.
Below check the <Timeline />
component anatomy.
For more information about the <Timeline />
component, check the Timeline Documentation.
The <Tooltip />
component is completely rewritten to make it more flexible and easier to use.
Below check the <Tooltip />
component anatomy.
For more information about the <Tooltip />
component, check the Tooltip Documentation.
The loading
prop is removed and doesn't work anymore.
The shadow
prop is removed and doesn't work anymore.
The variant
, color
, shadow
and floated
props are removed and doesn't work anymore.
The divider
prop is removed and doesn't work anymore.
The <ListItemPrefix />
is replaced with <ListItemStart />
.
The <ListItemSuffix />
is replaced with <ListItemEnd />
.
handler
prop replaced with onOpenChange
.dismiss
, lockScroll
and allowHover
props are removed and doesn't work anymore.The <MenuHandler />
is replaced with <MenuTrigger />
.
The <MenuList />
is replaced with <MenuContent />
.
The ratedColor
and unratedColor
props are removed and doesn't work anymore, instead you can use the color
prop.
The label
, ripple
, containerProps
, labelProps
, circleProps
and inputRef
props are removed and doesn't work anymore.
label
prop you can use <Typography />
component as a label this gives you more flexibility to style the label.inputRef
removed because the <Switch />
component is a native html input element and you can use the ref
prop for passing ref to the input element.containerProps
, labelProps
and circleProps
are removed because now all the of the styles are applied directly to the className
props as before:
and after:
pseudo elements.error
prop is replaced with isError
.success
prop is replaced with isSuccess
.variant
, label
, labelProps
, containerProps
and shrink
props are removed and doesn't work anymore.variant
prop is replaced with type
.textGradient
prop is removed and doesn't work anymore.