New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-plugin-material-ui

Package Overview
Dependencies
Maintainers
3
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-material-ui

Gatsby plugin for Material-UI with built-in server-side rendering support

  • 4.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.1K
decreased by-20.93%
Maintainers
3
Weekly downloads
 
Created
Source

gatsby-plugin-material-ui

A Gatsby plugin for @material-ui with built-in server-side rendering support.

This is the plugin for Material-UI v5 (emotion). The plugin for v4 can be found here.

Install

npm install gatsby-plugin-material-ui@next @emotion/react

Theme vs. Plugin

  • gatsby-plugin-material-ui solves FOUC, auto prefixing and minification.
  • gatsby-theme-material-ui uses the plugin under the hood, adds web fonts, meta-viewport, CSS baseline and mui theme support and has material ui styled gatsby link components

How to use

The default options should be enough to cover the most common use cases.

// gatsby-config.js

module.exports = {
  plugins: [`gatsby-plugin-material-ui`],
};

Advanced

You can use the pathToEmotionCacheProps option for low level customization of how styles get inserted by emotion.

// gatsby-config.js

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-material-ui`,
      options: {
        pathToEmotionCacheProps: `src/emotion-cache-props`,
      },
    },
  ],
};
// src/emotion-cache-props.js
const emotionCacheProps = {
  key: `xyz`,
  nonce: `XXXYYYZZZ`
};

export default emotionCacheProps;

Examples

You can find an official integration example of this plugin on the Material-UI site, then you can pick one of the Page Layout Examples.

If you want to save time with a more opinionated solution. You can start with a premade theme.

Keywords

FAQs

Package last updated on 16 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc