Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

mui get theme color in component

// Accessing the theme in a component
import { useTheme } from '@mui/material/styles';

function DeepChild() {
  const theme = useTheme();
  return <span>{`spacing ${theme.spacing}`}</span>;
}
Source by mui.com #
 
PREVIOUS NEXT
Tagged: #mui #theme #color #component
ADD COMMENT
Topic
Name
4+5 =