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

@mui/system

Package Overview
Dependencies
Maintainers
11
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui/system

MUI System is a set of CSS utilities to help you build custom designs more efficiently. It makes it possible to rapidly lay out custom designs.

  • 6.1.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
11
Created

What is @mui/system?

The @mui/system package is a utility library that provides a suite of CSS utilities for building consistent, theme-based styles across your React application. It is part of the Material-UI ecosystem and offers a way to apply styles using a set of predefined functions and hooks that work with Material-UI's theme object.

What are @mui/system's main functionalities?

Box Component

The Box component serves as a wrapper component for most CSS utility needs. The 'sx' prop is used to apply styles directly, leveraging the theme values for consistency.

{"<Box sx={{ color: 'primary.main', p: 2, m: 1, fontSize: 'h6.fontSize', fontWeight: 'fontWeightMedium' }}>Hello World</Box>"}

System Props

System props allow you to apply styles using specific properties that map to theme values. This is an alternative to the 'sx' prop for applying styles.

{"<Box color='primary.main' p={2} m={1} fontSize='h6.fontSize' fontWeight='fontWeightMedium'>Hello World</Box>"}

Custom Style Functions

Custom style functions allow you to define your own style functions that can be used with the 'styled' utility. This enables you to create more complex and reusable style definitions.

{"import { styled } from '@mui/system';\nconst MyComponent = styled('div')(({ theme }) => ({\n  color: theme.palette.primary.main,\n  padding: theme.spacing(2),\n  margin: theme.spacing(1),\n  fontSize: theme.typography.h6.fontSize,\n  fontWeight: theme.typography.fontWeightMedium\n}));"}

Responsive Values

The package supports responsive values, allowing you to specify different styles for different breakpoints. This is done using an object that maps breakpoints to values within the 'sx' prop or system props.

{"<Box sx={{ width: { xs: 100, sm: 200, md: 300, lg: 400, xl: 500 } }}>Responsive Box</Box>"}

Other packages similar to @mui/system

Keywords

FAQs

Package last updated on 02 Oct 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