/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/data/material/customization/creating-themed-components/StatComponent.js
37 строк
892 B
Brijesh Bittu
[code-infra] Remove React import requirement for jsx (#47146)
29 окт 2025, 20:55
Не верифицирован
29 окт 2025, 20:55
6c9e82f
Код
Авторство
О чём код?
import { styled } from '@mui/material/styles'; const StatRoot = styled('div')(({ theme }) => ({ display: 'flex', flexDirection: 'column', gap: theme.spacing(0.5), padding: theme.spacing(3, 4), backgroundColor: theme.palette.background.paper, borderRadius: theme.shape.borderRadius, boxShadow: theme.shadows[2], letterSpacing: '-0.025em', fontWeight: 600, ...theme.applyStyles('dark', { backgroundColor: 'inherit', }), })); const StatValue = styled('div')(({ theme }) => ({ ...theme.typography.h3, })); const StatUnit = styled('div')(({ theme }) => ({ ...theme.typography.body2, color: theme.palette.text.secondary, ...theme.applyStyles('dark', { color: 'inherit', }), })); export default function StatComponent() { return ( <StatRoot> <StatValue>19,267</StatValue> <StatUnit>Active users / month</StatUnit> </StatRoot> ); }