RTL Support
Mantine is built with emotion which supports RTL languages with stylis-plugin-rtl.
Install stylis-plugin-rtl
:
Add dir="rtl"
to html
element:
Add stylis-plugin-rtl
and theme.dir
to your MantineProvider:
Dynamic direction changes
To make rtl dynamic, change cache key when cache changes (!important cache key cannot be the same):
RTL with Next.js
To setup RTL support for Next.js:
- Replace your
_document.tsx
with
- In your
_app.tsx
setdir: 'rtl'
prop on theme and provideemotionOptions
, important!emotionOptions
should be the same as you've provided increateStylesServer
: