import { Box as SystemBox, BoxProps as SystemBoxProps, createBox } from '@mui/system'; import { expectType } from '@mui/types'; import Box, { BoxProps as MaterialBoxProps } from '@mui/material/Box'; import { createTheme } from '@mui/material/styles'; function ThemeValuesCanBeSpread() { ({ ...theme.typography.body1, color: theme.palette.primary.main, })} />; ({ ...theme.mixins.toolbar, color: theme.palette.primary.main, })} />; ({ ...theme.mixins.toolbar, color: 'primary.main', })} />; } // Compatibility with Material UI's Box const defaultTheme = createTheme({}); const CustomBox = createBox({ defaultTheme }); expectType(CustomBox); // @ts-expect-error System's Box has different type than Material UI's Box expectType(CustomBox); function ColorTest() { theme.vars.palette.common.black} sx={(theme) => ({ backgroundColor: theme.vars.palette.background.default })} />; } function ComponentTest() { return ; } expectType('span'); expectType(ComponentTest);