Skip to content

Commit

Permalink
add useTheme section
Browse files Browse the repository at this point in the history
  • Loading branch information
siriwatknp committed Oct 17, 2023
1 parent 190343d commit eaa5fda
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,21 @@ extendTheme({

#### useTheme hook

missing
To access the theme object, use the `useTheme` hook. It must be used within a component that is wrapped in the `CssVarsProvider` component.

```jsx
import { useTheme } from '@mui/joy/styles';

const SomeComponent = () => {
const theme = useTheme(); // The runtime theme.

return (
<div>
<p>{theme.vars.palette.primary[500]}</p>
</div>
);
};
```

### Creating new variables

Expand Down

0 comments on commit eaa5fda

Please sign in to comment.