MUI System
MUI System is a collection of CSS utilities to help you rapidly build custom designs with Material UI components. It provides low-level styling utilities as an alternative to writing CSS directly.What is MUI System?
MUI System is a set of CSS functions that gives you access to the theme values and provides shortcuts for common CSS properties. It includes:- Style functions - Utility functions for borders, display, flexbox, grid, palette, positions, shadows, sizing, spacing, and typography
sxprop - A shortcut for defining custom styles with access to the themestyled()API - A utility for creating styled componentsBoxcomponent - A wrapper component for quickly prototyping layouts
Key Features
Theme-aware Styling
All style functions are connected to the theme, allowing you to reference theme values directly:Responsive Values
Easily create responsive designs by passing arrays or objects:Type-safe
Full TypeScript support with type inference and autocomplete for all style properties.Installation
Core Concepts
Style Functions
MUI System exports individual style functions for different CSS categories:The sx Prop
The sx prop is a shorthand for defining custom styles with access to the theme:
Composition
Style functions can be composed together using thecompose utility:
Architecture
MUI System is built on top of@mui/styled-engine (Emotion by default) and provides:
- Style functions - Individual utilities for specific CSS categories
sxprop implementation - ThroughstyleFunctionSx- Theme integration - Via
handleBreakpointsand theme path resolution - Component factories -
createStyled,createBoxfor building components
Source Structure
The main exports from@mui/system:
Next Steps
- Getting Started - Installation and setup guide
- The
sxProp - Detailed guide on using thesxprop - styled() API - Creating styled components
- Box Component - Using the Box wrapper component