#Switch custom style
10 messages · Page 1 of 1 (latest)
You can use color prop
<Switch
color={checked ? 'red' : 'green'}
/>
color prop takes only MantineColor , i want to use a custom color
Ok, you need to style track element not input
kindly see my code I already use track and it change the switch color when it is unchecked only
@peak coral can u help please ?
Use Styles API, explore component source code to find selectors that you need to use
I use Styles API and the selector that I need is Track but it takes the custom color only it is unchecked only when it becomes checked it takes mantine blue color
this helps me , may it help other with same issue : https://mantine.dev/theming/colors/