Show Recent color in Angular Color picker component
19 Sep 20241 minute to read
The showRecentColors property enables the display of recently selected colors in the ColorPicker when in palette mode. This feature helps users quickly access their most frequently used colors.
Note: The
showRecentColorsfeature displays up to 10 recent colors as tiles and is available only inpalettemode.
In the following sample, the showRecentColors property is enabled to display recent colors in the palette area.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { FormsModule } from '@angular/forms'
import { ColorPickerModule } from '@syncfusion/ej2-angular-inputs'
import { enableRipple } from '@syncfusion/ej2-base'
import { Component } from '@angular/core';
@Component({
imports: [
FormsModule, ColorPickerModule
],
standalone: true,
selector: 'app-root',
template: `<div class="e-section-control">
<h4>Choose Color</h4>
<ejs-input ejs-colorpicker type="color" id="element" [showRecentColors]="true" mode="Palette" /></div>`
})
export class AppComponent { }import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));