An open API service indexing awesome lists of open source software.

https://github.com/guoyunhe/material-compact

Helper to create compact @mui/material theme
https://github.com/guoyunhe/material-compact

material material-design material-ui mui theme

Last synced: about 1 month ago
JSON representation

Helper to create compact @mui/material theme

Awesome Lists containing this project

README

        

# Material Compact

Helper to create compact `@mui/material` (material-ui) theme

- Components are more compact in size
- `Button`, `TextField`, `Autocomplete` and `Select` share same height
- `TextField`, `Autocomplete` and `Select` support large size
- `Button` text are not forced uppper-case anymore

## Install

```bash
npm install --save material-compact
```

## Usage

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

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

render(




Button



Button



Button



);
```

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

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

## Comparison

```jsx
import { Button, createTheme, Stack, TextField, ThemeProvider, Typography } from '@mui/material';
import { createCompactTheme } from 'material-compact';

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

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

render(



Compact Theme


Button



Button





Normal Theme


Button



Button




);
```

👉 [check online preview](https://guoyunhe.github.io/material-compact/)