In my app, the mantine Title component needs to have responsive font-size (different sizes at different breakpoints) ONLY when props.size = h1. Is there a way to conditionally set defaultProps in theme.components based on a props value? I see this is possible for styles and classnames using the callback, but it doesn't look like defaultProps accepts a callback. Currently, we are using a css module and a callback for classNames to accomplish this, but we feel it would be cleaner if we could use defaultProps and the provided responsive style props.
#Conditional Default Props in Theme
6 messages · Page 1 of 1 (latest)
wow I've been wondering the same thing!
Mantine does not provide such feature, you need to create a wrapper component for that
Thank you for your response, @viral ibex
@viral ibex Thanks!
use like this: ```const size = useMediaQueryValue({base:12, xs: 14, sm: 15, md: 16, lg: 17, xl: 19});