-
This is possibly a simple question, but having read the documentation I can't figure it out. I think I'm missing an example. Taking the pseudo-code below, at the moment, the switch is grey when false and green when true. What if I want to change the grey (when false) to yellow, or the green (when true) to blue. What do I need to do to this pseudo-code?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, there 👋 <script>
import { NSwitch } from 'naive-ui'
export default {
components: {
NSwitch,
},
data() {
return {
switch: true,
switchThemeOverrides: {
railColor: '#FFFF00',
railColorActive: '#0000FF'
}
}
}
}
</script>
<template>
<div class="example">
<n-switch v-model:value="switch" :theme-overrides="switchThemeOverrides"/>
</div>
</template>
<style>
.example {
border: 5px solid white;
padding: 20px;
}
</style> The document: https://www.naiveui.com/en-US/light/docs/customize-theme#Customizing-component-theme-vars |
Beta Was this translation helpful? Give feedback.
Hi, there 👋
you can try the prop
theme-overrides
to override style, like thisThe document: https://www.naiveui.com/en-US/light/docs/customize-theme#Customizing-component-theme-vars
The themes in Naive UI are customizable. …