Migrating from legacy StrataKit
Learn how to migrate from legacy StrataKit components to StrataKit MUI
This guide provides the necessary steps for migrating from legacy StrataKit components (e.g. @stratakit/bricks) to MUI-based StrataKit implementation.
Migration steps
Section titled “Migration steps”-
Set up StrataKit MUI
Follow the set up StrataKit MUI guide to install the necessary dependencies and set up your project.
-
Replace
@stratakit/foundationswith@stratakit/muiReplace the
Rootcomponent from@stratakit/foundationswith theRootcomponent from@stratakit/mui. This unlocks the ability to use MUI components within theRoot. Legacy StrataKit components nested within theRootwill continue to work, enabling gradual migration.import { Root } from "@stratakit/foundations";import { Root } from "@stratakit/mui";Replace usage of
Iconcomponent from@stratakit/foundationswith theIconcomponent from@stratakit/mui. Continue using icons from the@stratakit/iconspackage.import { Icon } from "@stratakit/foundations";import { Icon } from "@stratakit/mui";Once all direct usage of
@stratakit/foundationshas been replaced, it is safe to remove the dependency.Terminal window npm uninstall @stratakit/foundations -
Replace
@stratakit/brickswith@mui/materialReplace the usage of components from
@stratakit/brickswith their MUI counterparts. Refer to the use MUI components section below for the component mapping and additional guidance.import { Button } from "@stratakit/bricks";import Button from "@mui/material/Button";Once all usage of
@stratakit/brickshas been replaced, it is safe to remove the dependency.Terminal window npm uninstall @stratakit/bricks -
Continue using
@stratakit/structuresReplace the usage of
AccordionItem,BannerandChipcomponents from@stratakit/structurespackage with their MUI counterparts.import { Chip } from "@stratakit/structures";import Chip from "@mui/material/Chip";Continue using other components from
@stratakit/structurespackage, as they are not affected by the migration to StrataKit MUI.
Use MUI components
Section titled “Use MUI components”Replace legacy StrataKit component usage with their MUI counterparts.
AccordionItem
Section titled “AccordionItem”- Replace the
AccordionItemcomponent from@stratakit/structureswith theAccordioncomponent from@mui/material. See Accordion examples for reference. - Change
AccordionItem.Rootcomponent toAccordioncomponent. - Change
AccordionItem.Headercomponent toAccordionSummarycomponent. - Change
AccordionItem.Contentcomponent toAccordionDetailscomponent. - Change
AccordionItem.Labelcomponent toTypographycomponent. - Remove usage of
AccordionItem.Buttoncomponent. Button is configured viaAccordionSummarycomponent instead. - Remove usage of
AccordionItem.Decorationcomponent. Provide custom content toAccordionSummarycomponent instead. - Use
expandIconWrapperslot to replace usage ofAccordionItem.Markercomponent. - Use
headingslot to replace usage ofAccordionItem.Headingcomponent.
Anchor
Section titled “Anchor”-
Replace the
Anchorcomponent from@stratakit/brickswith theLinkcomponent from@mui/material. See Link examples for reference. -
Change
toneprop tocolorprop.tonevaluecolorvalue"neutral""secondary""accent""primary" -
Usage of compositional API is not available. External marker is not supported.
Avatar
Section titled “Avatar”- Replace the
Avatarcomponent from@stratakit/brickswith theAvatarcomponent from@mui/material. See Avatar examples for reference. - Change
imageprop to:childrenprop for icon avatars.srcprop for image avatars.
- Change
initialsprop tochildrenprop. - Change
sizeprop to explicitheightandwidthCSS properties.
-
Replace the
Badgecomponent from@stratakit/brickswith theBadgecomponent from@mui/material. See Badge examples for reference. -
Use
inlineprop to display the badge in normal document flow. -
Change
toneprop tocolorprop.tonevaluecolorvalue"neutral""secondary""accent""primary""info""info""positive""success""attention""warning""critical""error" -
Remove
variantprop. Only"standard"variant is supported by MUI component.
Banner
Section titled “Banner”-
Replace the
Bannercomponent from@stratakit/structureswith theAlertcomponent from@mui/material. See Alert examples for reference. -
Change
Banner,Banner.Rootcomponents toAlertcomponent. -
Change usage of
labelprop andBanner.Labelcomponent toAlertTitlecomponent. -
Change usage of
messageprop andBanner.Messagecomponent tochildrenprop. -
Change usage of
actionsprop andBanner.Actionscomponent toactionprop. Customize action container viaactionslot. -
Change usage of
iconprop andBanner.Iconcomponent toiconprop. Customize icon container viaiconslot. -
Change usage of
Banner.DismissButtoncomponent toonClose,closeTextprops andcloseButton,closeIconslots. -
Change
toneprop toseverityprop.tonevalueseverityvalue"neutral""success""info""info""positive""success""attention""warning""critical""error" -
Update value of
variantprop.Before After "outline""outlined"
Button
Section titled “Button”-
Replace the
Buttoncomponent from@stratakit/brickswith theButtoncomponent from@mui/material. See Button examples for reference. -
Change
toneprop tocolorprop.tonevaluecolorvalue"neutral""secondary""accent""primary" -
Update value of
variantprop.Before After "solid""contained""outline""outlined""ghost""text" -
Use
startIconandendIconprops to display icons.
Checkbox
Section titled “Checkbox”- Replace the
Checkboxcomponent from@stratakit/brickswith theCheckboxcomponent from@mui/material. See Checkbox examples for reference. - Use
FormControlLabelcomponent to label the checkbox.
-
Replace the
Chipcomponent from@stratakit/structureswith theChipcomponent from@mui/material. See Chip examples for reference. -
Change usage of
labelprop andChip.Labelcomponent tolabelprop. Customize label container vialabelslot. -
Change usage of
Chip.DismissButtoncomponent toonDelete,deleteIconprops. -
Update value of
variantprop.Before After "outline""outlined""solid""filled"
Description
Section titled “Description”- Replace the
Descriptioncomponent from@stratakit/brickswith theFormHelperTextcomponent from@mui/material. - Remove
toneprop. Instead useerrorprop to display the message in an error state.
Divider
Section titled “Divider”- Replace the
Dividercomponent from@stratakit/brickswith theDividercomponent from@mui/material. See Divider examples for reference. - Remove unsupported
bleedprop. - Replace unsupported
presentationalprop with arenderprop that overrides the element type and role:render={<div role={undefined} />}.
- Replace the
Fieldcomponent from@stratakit/brickswith theFormControlcomponent from@mui/material. - Change
Field.Root,Field.LabelandField.Controlcomponents withFormControlLabel. - Use
FormControl,FormLabelandFormGroupcomponents to group multiple fields. - Change
Field.Descriptioncomponent withFormHelperTextcomponent to display a description. - Change
Field.ErrorMessagecomponent withFormHelperTextcomponent to display an error message.
- Change
Kbdcomponent to a<kbd>element.
IconButton
Section titled “IconButton”- Replace the
IconButtoncomponent from@stratakit/brickswith theIconButtoncomponent from@mui/material. See IconButton examples for reference. - Change
iconprop tochildrenprop. - Remove
activeprop. UseToggleButtoncomponent to display a toggle button. - Remove
dotprop. Wrap the icon in aBadgecomponent to display a badge. - Remove
labelVariantprop. Use a visually hidden label, without a wrapperTooltip. - Remove
variantprop. Only"ghost"variant is supported by MUI component.
ProgressBar
Section titled “ProgressBar”-
Replace the
ProgressBarcomponent from@stratakit/brickswith theLinearProgresscomponent from@mui/material. See Progress examples for reference. -
Remove unsupported
sizeprop. -
Change
toneprop tocolorprop.tonevaluecolorvalue"neutral""secondary""accent""primary"
- Replace the
Radiocomponent from@stratakit/brickswith theRadiocomponent from@mui/material. See Radio examples for reference. - Use
FormControlLabelcomponent to label the radio control. - Use
RadioGroupcomponent to group multiple radio buttons.
Select
Section titled “Select”- Replace the
Selectcomponent from@stratakit/brickswith theSelectcomponent from@mui/material. See Select examples for reference. - Change
Select.HtmlSelectcomponent toNativeSelectorSelectcomponent. - Remove
variantprop. Only"outlined"variant is supported by MUI component.
Skeleton
Section titled “Skeleton”-
Replace the
Skeletoncomponent from@stratakit/brickswith theSkeletoncomponent from@mui/material. See Skeleton examples for reference. -
Remove
sizeprop. Usefont-sizeCSS property orwidthandheightproperties based on the skeleton variant. -
Update value of
variantprop.Before After "text""text""object""rounded"
Spinner
Section titled “Spinner”-
Replace the
Spinnercomponent from@stratakit/brickswith theCircularProgresscomponent from@mui/material. See Progress examples for reference. -
Change the value of
sizeprop. MUIsizeprop uses pixel values or custom units when a string is provided. -
Change
toneprop tocolorprop.tonevaluecolorvalue"neutral""secondary""accent""primary"
Switch
Section titled “Switch”- Replace the
Switchcomponent from@stratakit/brickswith theSwitchcomponent from@mui/material. See Switch examples for reference. - Use
FormControlLabelcomponent to label the switch control.
-
Replace the
Textcomponent from@stratakit/brickswith theTypographycomponent from@mui/material. See Typography examples for reference. -
Update value of
variantprop.Before After "display-lg""h1""display-md""h2""display-sm""h3""headline-lg""h4""headline-md""h5""headline-sm""h6""body-lg""body1""body-md""body2""body-sm""body2""caption-lg""caption""caption-md""caption""caption-sm""caption""mono-sm""body2"(withfont-family: var(--stratakit-font-family-mono)CSS property)
TextBox
Section titled “TextBox”- Replace the
TextBoxcomponent from@stratakit/brickswith theTextFieldcomponent from@mui/material. See TextField examples for reference. - Set
labelprop instead of theField.Labelcomponent to display a label. - Set
startAdornmentorendAdornmentproperties ofslotProps.inputinstead of theTextBox.Iconcomponent to display an icon. - Set
multilineprop to display a multi-line text area, instead of using theTextBox.Textareacomponent. - Use
helperTextprop to display a description, instead of using theField.Descriptioncomponent. Additionally, seterrorprop to display an error, instead of using theField.ErrorMessagecomponent.
Tooltip
Section titled “Tooltip”- Replace the
Tooltipcomponent from@stratakit/brickswith theTooltipcomponent from@mui/material. See Tooltip examples for reference. - Change
contentprop totitleprop. - Change
typeprop with a"label"value todescribeChildprop with afalsevalue:type="label"→describeChild={false}. "none"value oftypeis not supported. Manually overridearia-attributes instead.
VisuallyHidden
Section titled “VisuallyHidden”- Use
visuallyHiddenCSS utility instead.
Common props
Section titled “Common props”accessibleWhenDisabled prop
Section titled “accessibleWhenDisabled prop”accessibleWhenDisabledprop is not supported.