# srjuggernaut-mui-theme

> custom mui theme for easy use in projects

Latest version **1.1.0** (published 2024-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install srjuggernaut-mui-theme
pnpm add srjuggernaut-mui-theme
yarn add srjuggernaut-mui-theme
bun add srjuggernaut-mui-theme
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2024-03-10 |
| First published | 2023-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | SrJuggernaut |
| Maintainers | srjuggernaut |
| Keywords | mui, mui theme |

## Links

- npm: https://www.npmjs.com/package/srjuggernaut-mui-theme
- Repository: https://github.com/SrJuggernaut/srjuggernaut-mui-theme
- Homepage: https://github.com/SrJuggernaut/srjuggernaut-mui-theme#readme
- Issues: https://github.com/SrJuggernaut/srjuggernaut-mui-theme/issues
- npm.io page: https://npm.io/package/srjuggernaut-mui-theme

## Recent versions

- 1.1.0 (latest) — 2024-03-10
- 1.0.0 — 2024-02-19
- 0.2.0 — 2023-05-29
- 0.1.2 — 2023-05-29
- 0.1.1 — 2023-05-28

## README

# SrJuggernaut Mui Theme

## Installation

Install the package and the required fonts with npm or yarn.


```bash
npm install srjuggernaut-mui-theme @fontsource/roboto @fontsource/source-code-pro
```

or

```bash
yarn add srjuggernaut-mui-theme @fontsource/roboto @fontsource/source-code-pro
```

## Usage

You can use the theme in your project like this:

```jsx
import React, { useMemo } from 'react';
import { ThemeProvider, createTheme } from '@mui/material'
import CssBaseline from '@material-ui/core/CssBaseline';
import { darkTheme, lightTheme } from 'srjuggernaut-mui-theme';

import "@fontsource/roboto/latin-300.css";
import "@fontsource/roboto/latin-400.css";
import "@fontsource/roboto/latin-700.css";
import "@fontsource/source-code-pro/latin-400.css";
import "@fontsource/source-code-pro/latin-900.css";

function App() {
  const [mode, setMode] = React.useState<PaletteMode>('light')

  const theme = useMemo(() => {
    if (mode === 'light') {
      return createTheme(lightTheme);
    }
    else {
      return createTheme(darkTheme);
    }
  }, [mode]);

  return (
    <ThemeProvider theme={theme}>
      <CssBaseline />
      <div className="App">
        <h1>Hello World</h1>
      </div>
    </ThemeProvider>
  );
} 
```
It is important to import the fonts in your project, otherwise the theme will not work properly, this is because the theme uses the fonts from the @fontsource packages and cannot be imported automatically because some packages complain about the fonts being imported from other places than the root component.

## License

[MIT](LICENSE) © [SrJuggernaut](https://srjuggernaut.dev)

---
_Source: https://npm.io/package/srjuggernaut-mui-theme · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
