Skip to content

guoyunhe/mui-material-compact

Repository files navigation

mui-material-compact

Helper to create compact @mui/material theme

Install

npm i mui-material-compact

Usage

import { ThemeProvider, TextField } from '@mui/material';
import { createCompactTheme } from 'mui-material-compact';

const theme = createCompactTheme({
  // Your theme options...
});

<ThemeProvider theme={theme}>
  <TextField size="small" />
  <TextField size="medium" />
  <TextField size="large" />
</ThemeProvider>;

If you are using TypeScript, modify your tsconfig.json to enable extra size variants:

{
  "compilerOptions": {
    "types": ["mui-material-compact/overrides"]
  }
}

👉 check online preview