Having trouble getting help?
Contact Support
Contact Support
Render palette alone in Vue Color picker component
11 Jun 20242 minutes to read
To render the Palette
alone in ColorPicker, specify the mode
property as Palette
, and set the modeSwitcher
property to false
.
In the following sample, the showButtons
property is disabled to hide the control buttons and it renders only the Palette
area.
<template>
<div class='wrap'>
<h4>Choose Color</h4>
<ejs-colorpicker mode="Palette" :showButtons="false" :modeSwitcher="false"></ejs-colorpicker>
</div>
</template>
<script setup>
import { ColorPickerComponent as EjsColorpicker} from '@syncfusion/ej2-vue-inputs';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
</script>
<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
.wrap {
margin: 0 auto;
width: 300px;
text-align: center;
}
</style>
<template>
<div class='wrap'>
<h4>Choose Color</h4>
<ejs-colorpicker mode="Palette" :showButtons="false" :modeSwitcher="false"></ejs-colorpicker>
</div>
</template>
<script>
import { ColorPickerComponent } from '@syncfusion/ej2-vue-inputs';
import { enableRipple } from '@syncfusion/ej2-base';
enableRipple(true);
export default {
name: "App",
components: {
"ejs-colorpicker": ColorPickerComponent
}
}
</script>
<style>
@import '../node_modules/@syncfusion/ej2-base/styles/material.css';
@import '../node_modules/@syncfusion/ej2-buttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-popups/styles/material.css';
@import '../node_modules/@syncfusion/ej2-splitbuttons/styles/material.css';
@import '../node_modules/@syncfusion/ej2-inputs/styles/material.css';
.wrap {
margin: 0 auto;
width: 300px;
text-align: center;
}
</style>
To render
Picker
alone specify themode
property as ‘Picker’.