Style props
All Mantine components now support the following style props:
Prop | CSS Property | Theme key |
---|---|---|
m | margin | theme.spacing |
mt | marginTop | theme.spacing |
mb | marginBottom | theme.spacing |
ml | marginLeft | theme.spacing |
mr | marginRight | theme.spacing |
mx | marginRight , marginLeft | theme.spacing |
my | marginTop , marginBottom | theme.spacing |
p | padding | theme.spacing |
pt | paddingTop | theme.spacing |
pb | paddingBottom | theme.spacing |
pl | paddingLeft | theme.spacing |
pr | paddingRight | theme.spacing |
px | paddingRight , paddingLeft | theme.spacing |
py | paddingTop , paddingBottom | theme.spacing |
bg | background | theme.colors |
c | color | theme.colors |
opacity | opacity | – |
ff | fontFamily | – |
fz | fontSize | theme.fontSize |
fw | fontWeight | – |
lts | letterSpacing | – |
ta | textAlign | – |
lh | lineHeight | – |
fs | fontStyle | – |
tt | textTransform | – |
td | textDecoration | – |
w | width | theme.spacing |
miw | minWidth | theme.spacing |
maw | maxWidth | theme.spacing |
h | height | theme.spacing |
mih | minHeight | theme.spacing |
mah | maxHeight | theme.spacing |
bgsz | background-size | – |
bgp | background-position | – |
bgr | background-repeat | – |
bga | background-attachment | – |
pos | position | – |
top | top | – |
left | left | – |
bottom | bottom | – |
right | right | – |
inset | inset | – |
display | display | – |
Style props support responsive styles:
Box with responsive style props
Flex component
Flex component is an alternative to Group and Stack components. It supports new responsive style props:
Focus ring styles on theme
You can now customize focus ring styles for all components in MantineProvider:
Responsive Header and Footer height
Header and Footer components now support responsive height:
Other changes
- Button component now supports
loaderPosition="center"
- Carousel now supports
onSlideChange
prop - MantineProvider now includes theme.primaryColor validation – it will throw an error if primary color was set to an invalid value
- use-form
onSubmit
can now be called without form event - Carousel now supports
withKeyboardEvents
prop that allows to disable keyboard events handling