---
productId: material-ui
components: GlobalStyles
---
# How to customize
Learn how to customize Material UI components by taking advantage of different strategies for specific use cases.
Material UI provides several different ways to customize a component's styles. Your specific context will determine which one is ideal. From narrowest to broadest use case, here are the options:
1. [One-off customization](#1-one-off-customization)
1. [Reusable component](#2-reusable-component)
1. [Global theme overrides](#3-global-theme-overrides)
1. [Global CSS override](#4-global-css-override)
## 1. One-off customization
To change the styles of _one single instance_ of a component, you can use one of the following options:
### The `sx` prop
The [`sx` prop](/system/getting-started/the-sx-prop/) is the best option for adding style overrides to a single instance of a component in most cases.
It can be used with all Material UI components.
{{"demo": "SxProp.js"}}
### Overriding nested component styles
To customize a specific part of a component, you can use the class name provided by Material UI inside the `sx` prop. As an example, let's say you want to change the `Slider` component's thumb from a circle to a square.
First, use your browser's dev tools to identify the class for the component slot you want to override.
The styles injected into the DOM by Material UI rely on class names that all [follow a standard pattern](https://v6.mui.com/system/styles/advanced/#class-names):
`[hash]-Mui[Component name]-[name of the slot]`.
In this case, the styles are applied with `.css-ae2u5c-MuiSlider-thumb` but you only really need to target the `.MuiSlider-thumb`, where `Slider` is the component and `thumb` is the slot. Use this class name to write a CSS selector within the `sx` prop (`& .MuiSlider-thumb`), and add your overrides.
{{"demo": "DevTools.js"}}
:::warning
These class names can't be used as CSS selectors because they are unstable.
:::
### Overriding styles with class names
If you want to override a component's styles using custom classes, you can use the `className` prop, available on each component.
To override the styles of a specific part of the component, use the global classes provided by Material UI, as described in the previous section **"Overriding nested component styles"** under the [`sx` prop section](#the-sx-prop).
Visit the [Style library interoperability](/material-ui/integrations/interoperability/) guide to find examples of this approach using different styling libraries.
### State classes
States like _hover_, _focus_, _disabled_ and _selected_, are styled with a higher CSS specificity. To customize them, you'll need to **increase specificity**.
Here is an example with the _disabled_ state and the `Button` component using a pseudo-class (`:disabled`):
```css
.Button {
color: black;
}
/* Increase the specificity */
.Button:disabled {
color: white;
}
```
```jsx