#Button variants + TypeScript

2 messages · Page 1 of 1 (latest)

ocean mural
#

Hi. Brand new to Mantine, and I'm looking at the documentation for creating variants. I'd like my button to be declared as:

<Button variant="primary" />
<Button variant="secondary" />
<Button variant="destructive" />

Using the variantColorResolver I've managed to get this working, however the variant prop on the button is not strongly typed. Is there a way of getting this to work without creating a custom button component wrapper to restrict the variants passed in?