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

@mui/styled-engine

Package Overview
Dependencies
Maintainers
11
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui/styled-engine

styled() API wrapper package for emotion.

  • 6.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.7M
increased by5.58%
Maintainers
11
Weekly downloads
 
Created

What is @mui/styled-engine?

The @mui/styled-engine package is a styling solution for MUI, a popular React UI framework. It acts as an abstraction layer over different styling solutions, allowing developers to switch between different styled engines, such as emotion or styled-components, without changing their MUI component usage. It provides a consistent API for defining styles for MUI components.

What are @mui/styled-engine's main functionalities?

Customization of MUI components

This feature allows developers to customize MUI components using a familiar CSS-in-JS syntax. The code sample demonstrates how to create a custom styled version of an MUI Button component with a specific background color and hover state.

{"const StyledButton = styled(Button)({ backgroundColor: 'lightblue', '&:hover': { backgroundColor: 'blue' } }); return <StyledButton>Styled Button</StyledButton>;"}

Theming support

The package provides theming support, enabling developers to define a theme object and apply it to MUI components using a ThemeProvider. The code sample shows how to define a custom theme with a primary color and apply it to a Button component.

{"const theme = createTheme({ palette: { primary: { main: '#007bff' } } }); return <ThemeProvider theme={theme}><Button color='primary'>Themed Button</Button></ThemeProvider>;"}

Style overrides

Developers can use the package to override default styles of MUI components at the theme level. The code sample illustrates how to override the font size of all Button components within a theme.

{"const theme = createTheme({ components: { MuiButton: { styleOverrides: { root: { fontSize: '1rem' } } } } }); return <ThemeProvider theme={theme}><Button>Button with Style Overrides</Button></ThemeProvider>;"}

Other packages similar to @mui/styled-engine

Keywords

FAQs

Package last updated on 03 Sep 2024

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