General
Last updated
Last updated
MUI Component APIs (available props) & Demos
You can find all the MUI components’ APIs (available props, etc.) and their demos
Sx prop ()
Beyond what is natively available to each MUI component for styling them (aka styling-related props -- see their API page to determine that), you will do most additional styling within the sx
prop (which all MUI components have)
Component prop
If you’d like to, you can use the (e.g. component=“header”), although most of the mappings are already done, so this is mostly only used for the MUI <Box />
component, for which the default mapping is just <div />
e.g. <Box component="img" src="…" width={200} />
would result in a final <img … />
HTML element, and also gives the <Box />
component access to the attributes that are normally available for the <img />
element (e.g. src, width, height, alt, etc.)
JSX (don't do this):
MUI (do this instead):
MUI (example 2):
**variant="paragraph"
is just the styling, NOT mapping the component to HTML
Using the component
prop, you can map an MUI component to become a certain HTML element (do this if you feel like taking into consideration the final HTML outputted to the screen, and want to follow ):