snehilvj / dash-mantine-components

Plotly Dash components based on Mantine React Components
https://www.dash-mantine-components.com
MIT License
572 stars 56 forks source link

[Feature Request] Support polymorphic components #310

Closed MichaelODeli closed 2 weeks ago

MichaelODeli commented 2 months ago

Hello. I noticed that the dmc.Button component lacks the href parameter, which will allow you to open links by clicking on this button. In Mantine docs this feature is figured as polymorphic component. Yes, there is a dmc.Anchor component for opening links, but in the body of my application it looks a little out of place.

AnnMarieW commented 2 months ago

Hi @MichaelODeli

Thanks for your suggestion! I'll update the issue as a feature request to support polymorphic components. It's a nice feature in the upstream Mantine library and it applies to several components, not just the Button.

This will be a major project, so in the meantine you can add the href prop to a dmc.Button by wrapping it with a dmc.Anchor or a dcc.Link like this:

 dmc.Anchor(dmc.Button("link"), href="https://google.com")
AnnMarieW commented 2 weeks ago

This needs more discussion about how (and if) this should be handled. Converting to a Discussion until there are more concrete plans.