/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/data/material/customization/theme-components/GlobalThemeOverrideSx.js
44 строки
1 KB
Brijesh Bittu
[code-infra] Remove React import requirement for jsx (#47146)
29 окт 2025, 20:55
Не верифицирован
29 окт 2025, 20:55
6c9e82f
Код
Авторство
О чём код?
import { ThemeProvider, createTheme } from '@mui/material/styles'; import Chip from '@mui/material/Chip'; import Check from '@mui/icons-material/Check'; const finalTheme = createTheme({ components: { MuiChip: { styleOverrides: { root: ({ theme }) => theme.unstable_sx({ // https://mui.com/system/getting-started/the-sx-prop/#spacing px: 1, py: 0.25, // https://mui.com/system/borders/#border-radius borderRadius: 1, // 4px as default. }), label: { padding: 'initial', }, icon: ({ theme }) => theme.unstable_sx({ mr: 0.5, ml: '-2px', }), }, }, }, }); export default function GlobalThemeOverrideSx() { return ( <ThemeProvider theme={finalTheme}> <Chip color="success" label={ <span> <b>Status:</b> Completed </span> } icon={<Check fontSize="small" />} /> </ThemeProvider> ); }