Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@material-ui/styles

Package Overview
Dependencies
Maintainers
8
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@material-ui/styles

Material-UI Styles - The styling solution of Material-UI.

  • 4.11.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
8
Created

What is @material-ui/styles?

The @material-ui/styles package is a library that allows you to manage styles in your React applications. It provides an API for defining styles that can be applied to components in a consistent and reusable manner. This package is part of the larger Material-UI framework, which is a popular set of tools for building React user interfaces according to the Material Design guidelines.

What are @material-ui/styles's main functionalities?

Theming

Allows you to create a custom theme and apply it globally across all components in your application using a ThemeProvider.

{
  import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
  const theme = createMuiTheme({
    palette: {
      primary: {
        main: '#556cd6',
      },
      secondary: {
        main: '#19857b',
      },
    },
  });
  function App() {
    return (
      <ThemeProvider theme={theme}>
        <YourComponent />
      </ThemeProvider>
    );
  }
}

CSS-in-JS

Provides a way to define styles using JavaScript, which allows for dynamic styling and access to props and theme in styles.

{
  import { makeStyles } from '@material-ui/core/styles';
  const useStyles = makeStyles({
    root: {
      background: 'linear-gradient(45deg, #FE6B8B 30%, #FF8E53 90%)',
      border: 0,
      borderRadius: 3,
      boxShadow: '0 3px 5px 2px rgba(255, 105, 135, .3)',
      color: 'white',
      height: 48,
      padding: '0 30px',
    },
  });
  function StyledComponent() {
    const classes = useStyles();
    return <button className={classes.root}>Styled Button</button>;
  }
}

Other packages similar to @material-ui/styles

Keywords

FAQs

Package last updated on 03 Apr 2022

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