Dash-mantine along with dash-bootstrap

Hi folks,
i have a question for my project that i want to use dash-mantine popover component only but rest of the layout is designed using dash-bootstrap-components. When i wam doing it i am getting error: r.useid is not a function.

So is it because i can’t use mantine along with bootstrap or other.

Hey @Upendra_Dwivedi,

this error pops up usually due to a wrong layout of dmc. Could you share the section of the code where you setup the mantineprovider?

Hi @Upendra_Dwivedi !

You have to wrap your whole layout into the MantineProvider component see here.

But tbh I would recommend using dash mantine just for one component because I think they send the whole library (currently around 2.7mb) to the client.

Oh haha haven’t sent that :smiley:

1 Like

I did not know that! Wow.

I actually try to not mix dbc and dmc. It may be due to lack of personal knowledge, but sometimes I find it difficult to style the layout as I want to. Feels like if the CSS of these components interfere with each other. As I said, might be completely my fault though :slight_smile:

I haven’t used dbc since the first time I saw dmc :smiley:
checkout the current PR async loading by AnnMarieW · Pull Request #521 · snehilvj/dash-mantine-components · GitHub by AnnMarie :slight_smile:

1 Like

Yeah, what would we do without @AnnMarieW ? :rolling_on_the_floor_laughing: :hugs:

2 Likes

Hi @AIMPED and @Datenschubse
I have found the solution, thanks to AnnMarieW 's Github repo for Dash Mantine Components, i missed this line, don’t know why it is required though ;).

dash._dash_renderer._set_react_version(‘18.2.0’), i missed this line and my code was throwing error.

2 Likes

Actually, this is true - there can be some CSS issues when using these libraries together. The easiest way to create an app with a consistent design is to stick with either DBC or DMC (and not use both)

And yes, it is possible to use both - for example, Vizro uses the date pickers from DMC even though their app is primarily based on Bootstrap. But it does take a lot of extra CSS to make a pixel perfect design.

1 Like