# Blazor Color Palette Overview

The <a href = "https://www.telerik.com/blazor-ui/colorpalette" target="_blank">Blazor Color Palette component</a> provides a list of color tiles for the user to pick a color by clicking or tapping. You can choose a [predefined list of colors](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/presets), or [create your own](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/custom-colors). Two-way binding and [events](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/events) let you react to the user choice.

If unlimited choice of colors is preferred, consider the [ColorGradient component](https://www.telerik.com/blazor-ui/documentation/components/colorgradient/overview) instead.

## Creating Blazor ColorPalette

1. Add the `<TelerikColorPalette>` tag to a Razor file.
2. Set the `Value` parameter to a `string` object. It supports one-way and two-way binding.

> caption Basic color palette with two-way value binding and a default predefined palette.

<demo metaUrl="client/colorpalette/overview/basic/" height="420"></demo>

## Predefined Colors

The ColorPalette component comes with multiple sets of predefined colors that are shown to the users. [Read more about the available predefined ColorPallete colors](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/presets).

## Custom Colors

The ColorPallete can work with your own set of colors. [Read more about the Blazor ColorPallete custom colors setup](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/custom-colors).

## Events

The Blazor ColorPalette fires value change and blur events that you can handle and further customize its behavior. [Read more about the Blazor ColorPalette events](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/events).

## ColorPalette Parameters

The Blazor ColorPalette provides various parameters to configure the component. Also check the [ColorPalette public API](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikcolorpalette).

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Parameter    | Type and Default Value                  | Description                                                                                                                                                                                                                                                                                               |
| ------------ | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Class`      | `string`                                | Renders a custom CSS class to the `<div class="k-colorpalette">` element.                                                                                                                                                                                                                                 |
| `Colors`     | `IEnumerable<string>` <br /> (`Office`) | The collection of colors for the user to choose from. Can be one of the [built-in preset palettes](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/presets), or [a custom list of colors](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/custom-colors). |
| `Columns`    | `int` <br /> (`10`)                     | The number of columns to use when rendering the Colors list. Determines the size of the component together with the `TileHeight` and `TileWidth`.                                                                                                                                                         |
| `Enabled`    | `bool` <br /> (`true`)                  | Whether the component is enabled.                                                                                                                                                                                                                                                                         |
| `Id`         | `string`                                | Renders as an `id` attribute of the `<div class="k-colorpalette">` element.                                                                                                                                                                                                                               |
| `TabIndex`   | `Nullable<int>`                         | Maps to the `tabindex` attribute of the `<div class="k-colorpalette">` element. Use it to customize the tabbing focus order on the page.                                                                                                                                                                  |
| `TileHeight` | `string`                                | The height of each individual color item. Determines the size of the component together with the `Columns` and `TileWidth`. Accepts [CSS dimension](https://www.telerik.com/blazor-ui/documentation/common-features/dimensions) strings.                                                                  |
| `TileWidth`  | `string`                                | The width of each individual color item. Determines the size of the component together with the `Columns` and `TileHeight`. Accepts [CSS dimension](https://www.telerik.com/blazor-ui/documentation/common-features/dimensions) strings.                                                                  |
| `Value`      | `string`                                | Sets the value of the input, can be used for binding. Accepts any valid [CSS `background-color` string](https://css-tricks.com/almanac/properties/b/background-color/). The preset palettes use HEX format (`#123abc`).                                                                                   |

See the [Input Validation](https://www.telerik.com/blazor-ui/documentation/common-features/input-validation) article.

## Example

The Blazor ColorPallete provides appearance settings. Control the size of the component through the `Columns`, `TileWidth` and `TileHeight` parameters.

> caption Make a large color palette with few columns

<demo metaUrl="client/colorpalette/overview/large/" height="420"></demo>

## Next Steps

* [Explore the ColorPallete predefined colors](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/presets)
* [Handle the ColorPallete events](https://www.telerik.com/blazor-ui/documentation/components/colorpalette/events)

## See Also

* [Live ColorPalette Demos](https://demos.telerik.com/blazor-ui/colorpalette/overview)
* [ColorPalette API Reference](https://www.telerik.com/blazor-ui/documentation/api/telerik.blazor.components.telerikcolorpalette)
