New to Kendo UI for AngularStart a free 30-day trial

ColorPickerComponent

Represents the Kendo UI ColorPicker component for Angular.

The ColorPickerComponent is a tool for choosing colors from Gradient and Palette views rendered in its popup. You can preview the selected color, revert it to its previous state, or clear it.

html
<kendo-colorpicker [(value)]="selectedColor"></kendo-colorpicker>

Selector

kendo-colorpicker

Export Name

Accessible in templates as #kendoColorPickerInstance="kendoColorPicker"

Inputs

NameTypeDefaultDescription

actionsLayout

ColorPickerActionsLayout

'end'

Configures the layout of the Apply and Cancel action buttons.

activeView

ColorPickerView

Sets the initially active view in the popup. Supports two-way binding.

adaptiveMode

AdaptiveMode

Enables or disables the adaptive mode. By default, adaptive rendering is disabled.

adaptiveSubtitle

any

Sets the subtitle of the ActionSheet rendered instead of the Popup on small screens. By default, the ActionSheet does not render a subtitle.

adaptiveTitle

string

Sets the title of the ActionSheet rendered instead of the Popup on small screens.

clearButton

boolean

true

Specifies whether the ColorPicker displays a Clear color button.

disabled

boolean

false

Sets the disabled state of the ColorPicker. To disable it in reactive forms, see Forms Support.

fillMode

InputFillMode

'solid'

The fillMode property specifies the background and border styles of the ColorPicker (see example).

format

OutputFormat

'rgba'

Specifies the output format of the ColorPicker.

If the input value is in a different format, the component parses it into the specified output format.

gradientSettings

GradientSettings

Configures the gradient displayed in the ColorPicker popup.

icon

string

Defines the name of an existing icon in the Kendo UI theme. Provide only the name of the icon without the k-icon or k-i- prefixes.

iconClass

string | string[] | {[key: string]: boolean}

A CSS class name which displays an icon in the ColorPicker button. iconClass is compatible with the ngClass syntax.

Takes precedence over icon if both are defined.

paletteSettings

PaletteSettings

Configures the palette displayed in the ColorPicker popup.

popupSettings

PopupSettings

Configures the popup of the ColorPicker.

preview

boolean

false

Displays Apply and Cancel action buttons and color preview panes.

When enabled, the component value does not change immediately upon color selection, but only after the Apply button is clicked.

The Cancel button reverts the current selection to its previous state, i.e., to the current value.

readonly

boolean

false

Sets the read-only state of the ColorPicker.

rounded

InputRounded

'medium'

The rounded property specifies the border radius of the ColorPicker (see example).

size

InputSize

'medium'

The size property specifies the padding of the ColorPicker internal elements (see example).

svgIcon

SVGIcon

Defines an SVGIcon to render within the button. The input can take either an existing Kendo SVG icon or a custom one.

tabindex

number

0

Sets the tabindex of the component.

value

string

Sets the value of the selected color.

views

ColorPickerView[]

Specifies the views rendered in the popup. By default, both the gradient and palette views are rendered.

Fields

NameTypeDefaultDescription

container

ViewContainerRef

Provides a reference to a container element inside the component markup. The container element references the location of the appended popup— for example, inside the component markup.

isFocused

boolean

Indicates whether the ColorPicker wrapper is focused.

isOpen

boolean

Returns the current open state. Returns true if the Popup (or ActionSheet in adaptive mode) is currently open.

Events

NameTypeDescription

activeColorClick

EventEmitter<ActiveColorClickEvent>

Fires when the left side of the ColorPicker wrapper is clicked. The event is triggered regardless of whether a ColorPicker icon is set or not.

The ActiveColorClickEvent event provides the option to prevent the popup opening.

activeViewChange

EventEmitter<string>

Fires when the view is about to change. Used to provide a two-way binding for the activeView property.

cancel

EventEmitter<ColorPickerCancelEvent>

Fires when the user cancels the current color selection.

Fires on preview pane or 'Cancel' button click.

close

EventEmitter<ColorPickerCloseEvent>

Fires when the Popup (or ActionSheet in adaptive mode) is about to close. This event is preventable. If you cancel it, the Popup (or the ActionSheet) remains open.

blur

EventEmitter<any>

Fires when the ColorPicker is blurred.

focus

EventEmitter<any>

Fires when the ColorPicker is focused.

open

EventEmitter<ColorPickerOpenEvent>

Fires when the Popup (or ActionSheet in adaptive mode) is about to open. This event is preventable. If you cancel it, the Popup (or the ActionSheet) remains closed.

valueChange

EventEmitter<any>

Fires when the value changes.

Methods

blur

Blurs the ColorPicker.

focus

Focuses the wrapper of the ColorPicker.

reset

Clears the value of the ColorPicker.

toggle

Toggles the Popup (or ActionSheet in adaptive mode) of the ColorPicker. Does not trigger the open and close events of the component.

Parameters

open?

boolean

An optional parameter. Specifies whether the popup will be opened or closed.

In this article
SelectorExport NameInputsFieldsEventsMethods
Not finding the help you need?
Contact Support