New to Telerik UI for ASP.NET CoreStart a free 30-day trial

ASP.NET Core ColorPicker Overview

The Telerik UI ColorPicker TagHelper and HtmlHelper for ASP.NET Core are server-side wrappers for the Kendo UI ColorPicker widget.

The ColorPicker is a drop-down list for selecting colors.

Initializing the ColorPicker

The following example demonstrates how to define the ColorPicker.

Razor
    @(Html.Kendo().ColorPicker()
          .Name("colorpicker") // The name of the ColorPicker is mandatory. It specifies the "id" attribute of the widget.
          .Value("#ff0000") // Set the value of the ColorPicker.
    )

Starting with the 2024 Q3 release, the HtmlHelper version of the component supports declarative initialization.

Basic Configuration

The following example demonstrates how to configure the tile size, columns, Change event, and palette colors.

Razor

        @(Html.Kendo().ColorPalette()
			.Name("palette")
			.Columns(4)
			.TileSize(s => s.Width(34).Height(19))
			.Palette(new string[] {
				"#f0d0c9", "#e2a293", "#d4735e", "#65281a",
				"#eddfda", "#dcc0b6", "#cba092", "#7b4b3a",
				"#fcecd5", "#f9d9ab", "#f6c781", "#c87d0e",
				"#e1dca5", "#d0c974", "#a29a36", "#514d1b",
				"#c6d9f0", "#8db3e2", "#548dd4", "#17365d"
			})
			.Events(events => events.Change("preview"))
		)

Functionality and Features

FeatureDescription
AppearanceCustomize the ColorPicker appearance by using the available options.
ViewsThe component allows you to choose between gradient or palette view types.
Contrast ToolThe ColorPicker supports a contrast tool.
FormatsConfigure the ColorPicker input formats.
PalettesDefine a color palette that the user can pick from.
EventsThe ColorPicker allows you to handle its events and implement any custom logic.
[Adaptive Mode](% slug htmlhelpers_colorpicker_adaptive_mode_aspnetcore %)The ColorPicker supports an adaptive mode that renders a mobile-friendly popup.

Next Steps

See Also