Setup Mantine in Storybook
Note that this guide covers only Storybook 10.0+ integration. If you are using older version of Storybook, it will not work for you.
Add Storybook to your application
If you already have Storybook in your application, you can skip this step.
Follow Storybook getting started guide to add Storybook to your application:
Configure addons
Install @storybook/addon-themes Storybook addon:
Add addons to .storybook/main.ts:
Theme object
To shared theme object between your application and Storybook, create
src/theme.ts (or any other path in your application) file with your theme override:
Then you will be able to use the same theme both in your application and Storybook:
Storybook preview
If .storybook/preview.tsx file does not exist, create it and add
the following content:
All set! Start Storybook: