Skip to content

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.

  1. Set up StrataKit MUI

    Follow the set up StrataKit MUI guide to install the necessary dependencies and set up your project.

  2. Replace @stratakit/foundations with @stratakit/mui

    Replace the Root component from @stratakit/foundations with the Root component from @stratakit/mui. This unlocks the ability to use MUI components within the Root. Legacy StrataKit components nested within the Root will continue to work, enabling gradual migration.

    import { Root } from "@stratakit/foundations";
    import { Root } from "@stratakit/mui";

    Replace usage of Icon component from @stratakit/foundations with the Icon component from @stratakit/mui. Continue using icons from the @stratakit/icons package.

    import { Icon } from "@stratakit/foundations";
    import { Icon } from "@stratakit/mui";

    Once all direct usage of @stratakit/foundations has been replaced, it is safe to remove the dependency.

    Terminal window
    npm uninstall @stratakit/foundations
  3. Replace @stratakit/bricks with @mui/material

    Replace the usage of components from @stratakit/bricks with 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/bricks has been replaced, it is safe to remove the dependency.

    Terminal window
    npm uninstall @stratakit/bricks
  4. Continue using @stratakit/structures

    Replace the usage of AccordionItem, Banner and Chip components from @stratakit/structures package with their MUI counterparts.

    import { Chip } from "@stratakit/structures";
    import Chip from "@mui/material/Chip";

    Continue using other components from @stratakit/structures package, as they are not affected by the migration to StrataKit MUI.

Replace legacy StrataKit component usage with their MUI counterparts.

StrataKit componentMUI component
AccordionItemAccordion
AnchorLink
AvatarAvatar
BadgeBadge
BannerAlert
ButtonButton
CheckboxCheckbox
ChipChip
DescriptionFormHelperText
DividerDivider
FieldFormControl
IconButtonIconButton
Kbd-
LabelFormLabel
ProgressBarLinearProgress
RadioRadio
SelectSelect
SkeletonSkeleton
SpinnerCircularProgress
SwitchSwitch
TextTypography
TextBoxTextField
TooltipTooltip
VisuallyHidden-
  • Replace the Anchor component from @stratakit/bricks with the Link component from @mui/material. See Link examples for reference.

  • Change tone prop to color prop.

    tone valuecolor value
    "neutral""secondary"
    "accent""primary"
  • Usage of compositional API is not available. External marker is not supported.

  • Replace the Badge component from @stratakit/bricks with the Badge component from @mui/material. See Badge examples for reference.

  • Use inline prop to display the badge in normal document flow.

  • Change tone prop to color prop.

    tone valuecolor value
    "neutral""secondary"
    "accent""primary"
    "info""info"
    "positive""success"
    "attention""warning"
    "critical""error"
  • Remove variant prop. Only "standard" variant is supported by MUI component.

  • Replace the Button component from @stratakit/bricks with the Button component from @mui/material. See Button examples for reference.

  • Change tone prop to color prop.

    tone valuecolor value
    "neutral""secondary"
    "accent""primary"
  • Update value of variant prop.

    BeforeAfter
    "solid""contained"
    "outline""outlined"
    "ghost""text"
  • Use startIcon and endIcon props to display icons.

  • Replace the Checkbox component from @stratakit/bricks with the Checkbox component from @mui/material. See Checkbox examples for reference.
  • Use FormControlLabel component to label the checkbox.
  • Replace the Description component from @stratakit/bricks with the FormHelperText component from @mui/material.
  • Remove tone prop. Instead use error prop to display the message in an error state.
  • Replace the Divider component from @stratakit/bricks with the Divider component from @mui/material. See Divider examples for reference.
  • Remove unsupported bleed prop.
  • Replace unsupported presentational prop with a render prop that overrides the element type and role: render={<div role={undefined} />}.
  • Replace the ProgressBar component from @stratakit/bricks with the LinearProgress component from @mui/material. See Progress examples for reference.

  • Remove unsupported size prop.

  • Change tone prop to color prop.

    tone valuecolor value
    "neutral""secondary"
    "accent""primary"
  • Replace the Radio component from @stratakit/bricks with the Radio component from @mui/material. See Radio examples for reference.
  • Use FormControlLabel component to label the radio control.
  • Use RadioGroup component to group multiple radio buttons.
  • Replace the Skeleton component from @stratakit/bricks with the Skeleton component from @mui/material. See Skeleton examples for reference.

  • Remove size prop. Use font-size CSS property or width and height properties based on the skeleton variant.

  • Update value of variant prop.

    BeforeAfter
    "text""text"
    "object""rounded"
  • Replace the Spinner component from @stratakit/bricks with the CircularProgress component from @mui/material. See Progress examples for reference.

  • Change the value of size prop. MUI size prop uses pixel values or custom units when a string is provided.

  • Change tone prop to color prop.

    tone valuecolor value
    "neutral""secondary"
    "accent""primary"
  • Replace the Switch component from @stratakit/bricks with the Switch component from @mui/material. See Switch examples for reference.
  • Use FormControlLabel component to label the switch control.
  • Replace the Text component from @stratakit/bricks with the Typography component from @mui/material. See Typography examples for reference.

  • Update value of variant prop.

    BeforeAfter
    "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" (with font-family: var(--stratakit-font-family-mono) CSS property)
  • Replace the Tooltip component from @stratakit/bricks with the Tooltip component from @mui/material. See Tooltip examples for reference.
  • Change content prop to title prop.
  • Change type prop with a "label" value to describeChild prop with a false value: type="label"describeChild={false}.
  • "none" value of type is not supported. Manually override aria- attributes instead.
  • Continue using render prop to customize the rendering of the components. render prop is preferred over the component prop where available.